how to check if classlist contains class jquery code example
Example 1: js check for class in classList
element.classList.contains(className);
Example 2: jquery hasclass
$( "#mydiv" ).hasClass( "foo" )
element.classList.contains(className);
$( "#mydiv" ).hasClass( "foo" )