Ver originalvar links = document.getElementsByTagName("A"); var replace = ["somelink1", "somelink2", ...]; for(k=0, k<links.length;k++) links.setAttribute("href", replace[k]);