#12682 closed bug (notabug)
:eq() behavior does not match documentation
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The selector $('foo:eq(-1)') returns the last foo, but the documentation claims this should result in an empty set.
Fiddle demonstrating behavior: http://jsfiddle.net/Gj5Qj/3/
Documentation: http://api.jquery.com/eq-selector/
Specific documentation text: "Unlike the .eq(index) method, the :eq(index) selector does not accept a negative value for index. For example, while $('li').eq(-1) selects the last li element, $('li:eq(-1)') selects nothing."
Able to reproduce in both Chrome (v19) and Firefox (v11) on Linux.
Change History (3)
comment:1 Changed 10 years ago by
Status: | new → open |
---|
comment:2 Changed 10 years ago by
Keywords: | needsdocs added |
---|---|
Resolution: | → notabug |
Status: | open → closed |
Ported this over to https://github.com/jquery/api.jquery.com/issues/83 and closing this.
comment:3 Changed 10 years ago by
Keywords: | needsdocs removed |
---|
Note: See
TracTickets for help on using
tickets.
That was an intended change in 1.8, we wanted the method and the selector to have equivalent behavior. So yes the docs need to be updated.