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()
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week