Skip to content

Instantly share code, notes, and snippets.

@avireni
Created April 13, 2012 23:10
Show Gist options
  • Save avireni/2380718 to your computer and use it in GitHub Desktop.
Save avireni/2380718 to your computer and use it in GitHub Desktop.
filter index of an element in an unordered set
$("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