Free JavaSccript codes


Ever run into a situation where you want to get an array of all elements with a specific attribute? Or even want elements with a certain value for that chosen attribute as well? Just add this <a href=... detail at - 2.000+ free JavaScript codes

How to setup

Step 1: Copy & Paste JavaScript code below in your HEAD section
<script type="text/javascript">
Copyright Robert Nyman,
Free to use if this text is included 

function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue){
    var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\\s)" + strAttributeValue + "(\\s|$)") : null;
    var oCurrent;
    var oAttribute;
    for(var i=0; i<arrElements.length; i++){
        oCurrent = arrElements[i];
        oAttribute = oCurrent.getAttribute(strAttributeName);
        if(typeof oAttribute == "string" && oAttribute.length > 0){
            if(typeof strAttributeValue == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute))){
    return arrReturnElements;
    	This script downloaded from
    	Come to view and download over 2000+ free javascript at

JavaScript Countdown Timer - JavaScript Web based Music Player - JavaScript AJAX Page Content Loader
Quote Originally Posted by Copyright
The Site may provide, or third parties may provide, links to Internet World Wide Web sites or resources. Because has no control over such sites and resources, you acknowledge and agree that is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. You further acknowledge and agree that shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such site or resource.