Ariel, Thanks for pointing this out.
Since only simple selectors are supported, perhaps it would be less confusing if complex selectors returned undefined or null (consistent with the recent discussion about .attr()), instead of true? Jed Schmidt [EMAIL PROTECTED] On May 25, 1:51 am, Ariel Flesler <[EMAIL PROTECTED]> wrote: > is() supports only simple selectors, hierarchy ones cannot be used > with is() ($.filter). > > -- > Ariel Fleslerhttp://flesler.blogspot.com > > On 24 mayo, 13:18, Jed Schmidt <[EMAIL PROTECTED]> wrote: > > > Hello all, > > > I'm getting some weird behavior from jQuery (1.2.3 and 1.2.5 alike) > > when I use hierarchy selectors ("ancestor descendant", "parent > > > child", "prev + next", and "prev ~ siblings") in the argument of > > the .is() method. > > > For example, in a well-formed html document: > > > jQuery("body").is("div") > > // returns false as expected > > > jQuery("body").is("div *") > > jQuery("body").is("div > *") > > jQuery("body").is("div ~ *") > > jQuery("body").is("div + *") > > // all return true, even though the body element > > // isn't a child or sibling of a div element > > > jQuery("body").is("html#nonexistentid *") > > // returns true, even though the html element has no id > > > Is the .is() method supposed to support selectors with hierarchical > > relationships? > > > Jed Schmidt > > [EMAIL PROTECTED]