jQuery Tutorial Tutorials - jQuery .hasClass() method

jQuery .hasClass() method

The .hasClass(className) method in jQuery is used to check if the matched elements have class className.

It is equivalent to $.is("."+className).

jQuery .hasClass() method Syntax

$.hasClass(className)

the className is class name to search for.

jQuery .hasClass() method with Example

Highlight an element that contains a class.

Try now

Date:2019-08-19 16:18:58 From:www.Lautturi.com author:Lautturi