Side navigation
#7205 closed bug (invalid)
Opened October 15, 2010 09:40PM UTC
Closed March 30, 2011 08:54PM UTC
subtle difference in how :has() and .has() behave
Reported by: | Tomalak | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | selector | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The ":has()" Sizzle selector and the ".has()" jQuery function behave differently when the child selector ">" is used in a special (unary) way.
The goal is to select elements if they have certain children (not descendants).
$("ul:has(>li.active)"); // returns expected elements $("ul").has(">li.active"); // returns empty
Also see this Fiddle and this StackOverflow thread.
Version info: Tested and reproduced on FireFox 3.6, FireFox 4.0b6, Chrome 8.0.522.0 and IE9b (all Windows). It occurs with jQuery 1.3.2 through 1.4.3.
Attachments (0)
Change History (3)
Changed October 15, 2010 10:13PM UTC by comment:1
component: | unfiled → selector |
---|---|
milestone: | 1.next |
priority: | undecided → low |
status: | new → open |
version: | 1.4.2 → 1.4.3 |
Changed October 18, 2010 02:29PM UTC by comment:2
I have requested clarification on the proper interpretation of "> Child" and resultant selection in the core discussion.
Changed March 30, 2011 08:54PM UTC by comment:3
resolution: | → invalid |
---|---|
status: | open → closed |