Skip to main content

Bug Tracker

Side navigation

#4773 closed bug (duplicate)

Opened June 17, 2009 07:50AM UTC

Closed March 31, 2011 03:31AM UTC

Last modified March 31, 2011 03:31AM UTC

":has" sometimes can not find the right elements

Reported by: caii Owned by: john
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: has Cc:
Blocked by: Blocking:
Description

<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>

<ul><li>0</li><li>0</li></ul>

<ul><li>1</li><li>1</li><li>1</li><li>1</li></ul>

<script>

$("ul:has(li:eq(2))").css("background","red")/*can't find the second "ul" with jquery 1.3.2 but in jquery 1.2.6 ,this work correct.*/

</script>

Attachments (0)
Change History (3)

Changed November 17, 2010 04:24AM UTC by dmethvin comment:1

status: newopen

http://jsfiddle.net/dmethvin/GXLUY/

Confirmed. Should :has() be documented to only contain simple element/id selectors and not pseudos like :eq?

Changed March 31, 2011 03:31AM UTC by danheberden comment:2

resolution: → duplicate
status: openclosed

Changed March 31, 2011 03:31AM UTC by danheberden comment:3

Duplicate of #8720.