Re: [jQuery] get class name

2007-03-05 Thread Klaus Hartl
Glen Lipka schrieb: > If the ID only has one class you can also say: > $("#myID[class=foo]").fadeOut(); > or > var theNode = $("#myID[class=foo]") That should read $("[EMAIL PROTECTED]")! -- Klaus ___ jQuery mailing list discuss@jquery.com http://jque

Re: [jQuery] get class name

2007-03-05 Thread Aaron Heimlich
On 3/5/07, Glen Lipka <[EMAIL PROTECTED]> wrote: Also, wouldn't your example work without the IF? $("#myId).is("myClass").fadeOut(); or var theNode = $("#myId).is("myClass") Neither of those would work because is() returns true/false. [1] http://docs.jquery.com/DOM/Traversing#is.28_expr_

Re: [jQuery] get class name

2007-03-05 Thread Sam Collett
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).

Re: [jQuery] get class name

2007-03-05 Thread Glen Lipka
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 If you want to determine whether #myId has

Re: [jQuery] get class name

2007-03-05 Thread Aaron Heimlich
On 3/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: What is the jQuery syntax to ge the class name of an item with a known id? var myClassAttr = $("#myId").attr("class"); Will store the entire contents of #myId's "class" attribute in the variable "myClassAttr" If you want to determine w

[jQuery] get class name

2007-03-05 Thread dalvarado
Hi, What is the jQuery syntax to ge the class name of an item with a known id? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/