Passing a negative index for :eq throws a syntax error.
|Reported by:||r.osenkonstantinov@…||Owned by:||timmywil|
If negative index is set for :eq a syntax error is thrown. Here is a basic selector: $("div").children(":eq(-1)") and a jsbin sample http://jsbin.com/ovurif/1/edit.
The documentation states that it is not supported but an empty set will be returned. Which unfortunately is not true with the 1.8:
"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."
Change History (6)
comment:1 Changed 5 years ago by timmywil
- Component changed from unfiled to selector
- Milestone changed from None to 1.8.1
- Owner set to timmywil
- Priority changed from undecided to low
- Status changed from new to assigned
comment:4 Changed 4 years ago by Timmy Willison
- Resolution set to fixed
- Status changed from assigned to closed