Christopher Jordan schrieb:
> Hi folks,
> 
> How can I tell what class (or classes) an element has? For instance I've 
> got an elements like:
> 
> <div class="classA classB"></div>
> <div class="classA classC"></div>
> 
> How can I select all elements that have classA and ClassB but not classC?

$('div.classA, div.classB').not('.classC')

In case you want only elements that are of classA and classB use this:

$('div.classA.classB')


> I'd also like to know how to select all items of a certain class and 
> attribute. For instance:
> 
> <div class="classA" Status="On"></div>
> <div class="classA" Status="Off"></div>
> <div class="classA" Status="Off"></div>
> <div class="classA" Status="On"></div>
> <div class="classA" Status="Off"></div>
> <div class="classA" Status="Off"></div>
> 
> I want jQuery to match all the elements that are of classA and that have 
> the Status attribute set to "On". How would I do that?


$('div.classA').filter('[EMAIL PROTECTED]"On"]')


-- Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to