From 542da06c3e3542126cd54282d35ab1a3120f2d57 Mon Sep 17 00:00:00 2001
From: Ben Marvell
If we omit the argument, .index()
will return the position of the first element within the set of matched elements in relation to its siblings:
alert('Index: ' + $('#bar').index();
+ alert('Index: ' + $('#bar').index());
Again, we get back the zero-based position of the list item:
Index: 1