#8303 closed bug (duplicate)
:gt() inside :has()
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | unfiled | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
This code:
$('ul:has(li:gt(2))')
selects all UL elements that have more than 3 children.
Check out this demo: http://jsfiddle.net/RQBuZ/1/
As you can see, the above code works - all UL's with more than 3 children have a yellow background-color.
However, the demo uses jQuery 1.2.6. If you switch to any of the more recent versions of jQuery, the code stops working.
Change History (3)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Also, note that this selector:
has the same functionality as the above selector. And this selector also only works in 1.2.6 but not any more recent version of jQuery.
Demo: http://jsfiddle.net/RQBuZ/2/
Just to make sure that we agree on the semantics of the selector:
Select all UL elements which contain at least one LI element which is the 4-th child (of its parent).
Therefore, in the demo that I supplied above, the last two UL elements should be selected by this selector, but they're not.