i have an unordered list with an unknown number of list items. it looks like this:
<ul id="keyvisualpager">
<li><a><span>first</span></a></li>
<li><a><span>second</span></a></li>
<li><a><span>third</span></a></li>
<li><a><span>and so on</span></a></li>
<li><a><span>fsdfsf</span></a></li>
<li><a><span>asdad</span></a></li>
</ul>
when the user clicks on a link, i need to find out the index of the list element and assign it to a variable. e.g. if the user is clicking the second link ("second") the variable should be set to "2"...
$('#keyvisualpager li a').click(function () {
// receive index of list element
var mbr_index = ???;
});
i have to use jquery 1.2.1 ... so no fancy stuff please :)
any help is greatly appreciated, thanks!