I'm trying to test for the presence of class intra-field-label on an element. This element will have multiple classes. How may I do this?
-
Don't feel bad but before posting it on stackoverflow, make sure that question you are posting worth posting on stackoverflow, bcoz you can easily get the solution using google also.Aditya Singh– Aditya Singh2011-03-29 03:48:16 +00:00Commented Mar 29, 2011 at 3:48
-
Before Google, you should probably consult the actual documentationPhil– Phil2011-03-29 03:49:45 +00:00Commented Mar 29, 2011 at 3:49
Add a comment
|
4 Answers
For completeness, there's also .is() which takes any jQuery selector. This is more flexible, but for your particular case, Phil's answer is more appropriate.
Comments
The jquery selector for class is ".class", http://api.jquery.com/class-selector/
$('.intra-field-label')