How to get the index number of a link? on clicking on the link? i have tried this code, to display the values
alert("i am script");
var an=[];
var href=[];
var atext=[]
an = document.getElementsByTagName("a");
for(var i=0;i<an.length;i++)
{
alert("i am inside for");
href[i]=an[i].getAttribute("href");
atext[i]=an[i].innerHTML;
}