Answers for "see whether object has a class javascript"

39

javascript check if element has class

if(document.getElementById("myElmentID").classList.contains("hidden")){
// I have the 'hidden' class
}
Posted by: Guest on August-02-2019
0

how to check which class a object is from

if (obj instanceof C) {
//your code
}
Posted by: Guest on February-01-2021

Code answers related to "see whether object has a class javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language