Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript change all anchors color

colorLinks("#00FF00");

function colorLinks(hex)
{
    var links = document.getElementsByTagName("a");
    for(var i=0;i<links.length;i++)
    {
        if(links[i].href)
        {
            links[i].style.color = hex;  
        }
    }  
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #change #anchors #color
ADD COMMENT
Topic
Name
6+5 =