0

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

user784637
  • 14,282
  • 32
  • 89
  • 149
  • 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,453
  • 1
  • 28
  • 30
2

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

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

ShankarSangoli
  • 68,720
  • 11
  • 89
  • 123