jQuery hasClass() Method
jQuery hasClass() Method
The hasClass() method is used to check if any of the selected elements have a specified class name. If the class is present with the same name, then it will return true otherwise false.
Syntax:-
Its syntax is:- $(selector).hasClass(classname)
Further Explanation:-
Parameter | Description |
---|---|
classname | Required. Specifies the class name to search for in the selected elements |