Skip to main content

Bug Tracker

Side navigation

#6929 closed bug (invalid)

Opened August 23, 2010 04:11PM UTC

Closed August 26, 2010 12:23AM UTC

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");

Attachments (0)
Change History (3)

Changed August 23, 2010 04:14PM UTC by elijahr comment:1

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");

Changed August 23, 2010 05:32PM UTC by elijahr comment:2

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.

Changed August 26, 2010 12:23AM UTC by dmethvin comment:3

resolution: → invalid
status: newclosed