Created
May 22, 2012 20:32
-
-
Save bekapod/2771441 to your computer and use it in GitHub Desktop.
JQUERY: Find index of an element in unordered set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('ul > li').click(function() { | |
var index = $(this).prevAll().length; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment