[jQuery] Re: How to get the number of the selected element?
Thanks a lot! Works perfectly.
[jQuery] Re: How to get the number of the selected element?
I got 10 links on a site, all with the class collapsible. jQuery: $(document).ready(function(){ $('.collapsible').click(function() { var indexLink = $('.collapsible').index(this); var nClicked = indexLink + 1; alert(nClicked); }); }); HTML a href=# class=collapsible1/a a href=# class=collapsible2/a a href=# class=collapsible3/a ... MaurĂcio