Bug Tracker

Modify

Ticket #6929 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

jQuery.fn.is() returning true when it should be returning false

Reported by: elijahr Owned by:
Priority: Milestone: 1.4.3
Component: traversing Version: 1.4.2
Keywords: filtering is textnode Cc:
Blocking: Blocked by:

Description

There seems to be some issue with jQuery.fn.is() and text nodes. For instance, the last statement below should return false, but it is returning true.

/* put some HTML in the DOM */ $('<ol id="crumbs_menu"><li class="crumbs_link"><div></div></li></ol>').appendTo(document.body);

/* this should return false, but it returns true */ $().appendTo(document.body).is("#crumbs_menu li.crumbs_link:first > div");

Change History

comment:1 Changed 4 years ago by elijahr

It seems that some quotes were stripped from my example. The last statement should be:

/* this should return false, but it returns true */ $("\ ").appendTo(document.body).is("#crumbs_menu li.crumbs_link:first > div");

comment:2 Changed 4 years ago by elijahr

Apologies, this appears to be a duplicate of #4655, which was marked invalid. I used the :first-child selector and it solved my problem. You may close this as invalid as well. Thank you.

comment:3 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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.