Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript how to change anchor style

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 #anchor #style
ADD COMMENT
Topic
Name
6+5 =