On 05/03/07, Glen Lipka <[EMAIL PROTECTED]> wrote: > If the ID only has one class you can also say: > $("#myID[class=foo]").fadeOut(); > or > var theNode = $("#myID[class=foo]") > > Also, wouldn't your example work without the IF? > $("#myId).is("myClass").fadeOut(); > or > var theNode = $("#myId).is("myClass") > > Glen
No. 'is' returns true/false, not a jQuery object. You can use filter though: $("#myId).filter(".myclass").doStuff(); > > > > > > > > > If you want to determine whether #myId has a particular class or not use > this: > > > > if( $("#myId").is(".myClass") ) { > > // Do stuff... > > } > > > > -- > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/