Element rank (index)
<ul>
<li id="item-1">Item number 1
<li id="item-2">Item number 2
<li id="item-3">Item number 3
</ul>
var item = getElementById("item-3");
var rank = $($(item).parent().find("li")).index(item); // rank will be 2
Traversing
.first() - when obtaining a list of items from jQuery selector, it is often useful to pick the first item only