var links = document.getElementsByTagName('a'); for(var i=0;i