Ticket #10977 (closed bug: fixed)
Incorrect documentation for the index method?
|Reported by:||AbeMiessler@…||Owned by:||rwaldron|
You have the following documentation for index with no parameters:
If no argument is passed to the .index() method, the return value is an integer indicating the position of the first element within the jQuery object relative to its sibling elements.
But if you run this jQuery:
Against this HTML:
<ul> <li class="selected">First Item</li> <li class="disabled">Second Item</li> <li class="separator">Third Item</li> <li>Fourth Item</li> </ul>
It returns 3 instead of 0. You can see that the selector will find two elements (the first and last LI), but it returns the index of the last element, when your documentation says it will return the index of the first.
Can be seen in this fiddle: http://jsfiddle.net/Zf9Vv/
- Owner set to rwaldron
- Priority changed from undecided to high
- Status changed from new to assigned
- Component changed from unfiled to traversing
- Keywords needsdocs removed
- Status changed from assigned to closed
- Resolution set to notabug
- Status changed from closed to reopened
- Resolution notabug deleted