91-9990449935 0120-4256464 |
jQuery hasClass()The jQuery hasClass() method is used to check whether selected elements have specified class name or not. It returns TRUE if the specified class is present in any of the selected elements otherwise it returns FALSE. Syntax: Parameters of jQuery hasClass() method
Example of jQuery hasClass() methodLet's take an example to demonstrate jQuery hasClass() method. Test it NowjQuery hasClass() method example 2Let's take another example to demonstrate jQuery hasClass() method. Test it NowHere the first condition is true and the second is false. If we set the second paragraph class name ?blue? then both the conditions will be true.jQuery hasClass() Example 3Test it NowHere both the conditions will be true. jQuery hasClass() Example 4Test it Now
Next TopicjQuery toggleClass()
|