<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){
var myArray = [
{property: "value1"},
{property: "value2"},
{property: "value3"}
];
var pageLinks = document.getElementsByTagName("a");
for (i = 0, len = pageLinks.length; i < len; i++){
(function(i){
pageLinks[i].addEventListener("click", function(){
document.writeln(myArray[i].property);
document.writeln('<br/>');
}, false);
})(i);
}
}
</script>
</head>
<body>
<a href="#">link1</a>
<a href="#">link2</a>
<a href="#">link3</a>
</body>
</html>