Вот так можно
<!DOCTYPE HTML>
<html>
<head></head>
<body>
<a href="http://mail.ru">Mail.ru</a>
<a href="http://test.ru">Test.ru</a>
<script>
window.onload = function () {
var links = document.getElementsByTagName('a');
for (var i = 0, max = links.length; i < max; i++) {
links[i].onmouseover = function () {
this.href && (document.location.href = this.href);
}
}
};
</script>
</body>
</html>