Answers for "javascript check if div with class exists"

5

js check for class in classList

element.classList.contains(className);
Posted by: Guest on August-27-2020
1

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

Code answers related to "javascript check if div with class exists"

Code answers related to "Javascript"

Browse Popular Code Answers by Language