function getHref() { alert(this.href); } var links = document.getElementsByTagName("A"); for(var i = 0, l = links.length; i < l; i++) link.onmouseover = getHref;