how to check for a class js code example
Example 1: how to check which class a object is from
if (obj instanceof C) {
//your code
}
Example 2: how to check has class name in js?
element.classList.contains(className);Code language: CSS (css)
if (obj instanceof C) {
//your code
}
element.classList.contains(className);Code language: CSS (css)