Bug Tracker

Opened 5 years ago

Closed 5 years ago

#6929 closed bug (invalid)

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

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 (3)

comment:1 Changed 5 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 5 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 5 years ago by dmethvin

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.