Check If Any Matching Element Has CSS class .hasClass(class)

.hasClass(className)

e.g. $("div").hasClass("className")

.hasClass(className) will return true if className exists or false if it does not.

Example 1: $("div").hasClass("someClass") returns true if at least one <div> has someClass assigned to its class attribute.
// will return true 
<div class="someClass">A</div> // div has someClass
<div>B</div>
jQuery manipulation css .hasClass(class)