Answers for "javascript change all anchors color"

1

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;  
        }
    }  
}
Posted by: Guest on October-29-2021

Code answers related to "javascript change all anchors color"

Code answers related to "Javascript"

Browse Popular Code Answers by Language