window.onload = function() { var a = document.querySelectorAll('a[href]'), i; for(i=0; i<a.length; i++) a[i].onmouseover = function() { document.location = this.href; }); }