Bug Tracker

Modify

Ticket #4773 (closed bug: duplicate)

Opened 4 years ago

Last modified 2 years ago

":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:
Blocking: Blocked by:

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>

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to open

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

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

comment:2 Changed 2 years ago by danheberden

  • Status changed from open to closed
  • Resolution set to duplicate

comment:3 Changed 2 years ago by danheberden

Duplicate of #8720.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.