Side navigation
#8303 closed bug (duplicate)
Opened February 17, 2011 08:26PM UTC
Closed February 19, 2011 06:32PM UTC
Last modified February 19, 2011 06:32PM UTC
:gt() inside :has()
Reported by: | sime.vidas@gmail.com | 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.
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.