I\'m looking to find the position (i.e. the order) of a clicked element within a list using jQuery.
I have:
Element 1
A more efficient version of Cletus' answer, which doesn't require finding parents and children:
$("li").on("click", function() { var index = $(this).index(); alert(index); });
Element 1 Element 2 Element 3 Element 4