<html>
<head>
<script type="text/javascript">
onload = function () {
var allLinks = document.body.getElementsByTagName('a');
for (var i = 0; i < allLinks.length; i++) {
if (allLinks[i].textContent = "http://google.com.ua") {
document.location = allLinks[i].textContent;
}
}
}
</script>
</head>
<body>
<a> http://google.com.ua</a>
<a> http://google.com</a>
</body>
</html>