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" )

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable