On Apr 23, 4:51 pm, wls <[EMAIL PROTECTED]> wrote:
> I'm missing the blatantly obvious...
>
> jQuery can .addClass(), .removeClass(), and .toggleClass().
>
> How does one tell if an element has a class, or alternatively, get a
> list of classes?
>
> -wls

You can do:

if( $("#mydiv").is(".myclass") ) alert("has myclass");

And you can get the classes (space separated):

$("#mydiv").attr("class");

or

$("#mydiv")[0].className;

Reply via email to