Determine whether any of the matched elements are assigned the given class.
// <div id="menu" class="open"></div>
const isOpen = $('#menu').hasClass('open');
true
const hasError = $('input').hasClass('error');
// Returns true if *at least one* element has the class
true
| Parameter | Type | Description |
|---|---|---|
| className | string | The class name to search for. |
Returns: Boolean.