Posted By

daipratt on 12/24/09


Tagged

jquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

verostudios


Determine the index of an element, properly.


 / Published in: jQuery
 

  1. $("ul > li").click(function () {
  2. var index = $(this).prevAll().length;
  3. });

Report this snippet  

You need to login to post a comment.