index

Element indexes and jQuery

Posted by Danny Herran on Aug 10, 2010 in Frontend | No comments

Once the DOM is structured by the browser, each element in our HTML page has an index relative to its parent. Retrieving an element’s index with jQuery is an easy task, and it is so useful that it can save you a couple of lines of code.