how can i get index no.of clicking element?
<p>my UL have the 5 Li, in the li it has the a href, while i click on the a, it has to show the it's index no.from the ul. example if i click 3rd li, then it should alet 3. for that i am using this function:</p>

<pre><code>var titles = document.getElementById('bigscreen-titles');  if(titles){
    var links = titles.getElementsByTagName('a');

    for(i=0;i&lt;links.length;i++){
        links[i].onclick = function(){
            alert(i);
        }
    }
}
</code></pre>

<p>but it always show 5. even if i click on 1st li, it show the same, any correct way.. please</p>
