Answers for "if the class is present then jquery"

CSS
2

if a class exists jquery

if ($(".mydivclass").length){
    // Do something if class exists
} else {
    // Do something if class does not exist
}
Posted by: Guest on November-28-2020
5

detect if an element has a class jQurey

$("#EL_ID").hasClass("CLASS_NAME");
Posted by: Guest on May-14-2020

Code answers related to "if the class is present then jquery"

Browse Popular Code Answers by Language