0

Does jquery have a boolean function to determine if a particular element has a certain class?

user784637
  • 15,392
  • 32
  • 93
  • 156
  • 1
    Type the exact text of your question into Google and the first result is your question, the second result is the `.hasClass()` function within the jQuery API reference. Also this is a duplicate of [Determine if an element has a CSS class with jQuery](http://stackoverflow.com/questions/263232/determine-if-an-element-has-a-css-class-with-jquery) – nnnnnn Feb 23 '12 at 02:43

2 Answers2

8
$(selector).hasClass('whatclass')
aletzo
  • 2,471
  • 1
  • 27
  • 31
2

http://api.jquery.com/hasClass/

Here you will get all the information you need along with samples.

ShankarSangoli
  • 69,612
  • 13
  • 93
  • 124