hasClass() in jQuery
Using hasClass() method, we can check if the specified class name is present in the specified element or not.
It returns true if the specified class name is present, else it returns false.
Syntax
$(selector).hasClass(className)
- className - The class name to search for.