bigjoy,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body><a>bla</a><a>bla</a><a>bla</a><a>bla</a>
<script>
var a = document.querySelectorAll("a"), arr = [1,5,3,7];
for (var i=0; i<a.length; ) {a[i].href = arr[i], a[i].innerHTML += ++i}
</script>
</body>
</html>