xxxxxxxxxx
if (myElement.classList.contains('someClassname')) {
// do something
}
xxxxxxxxxx
element.classList.contains(className);Code language: CSS (css)
xxxxxxxxxx
if (typeof me.onChange !== "undefined") {
// safe to use the function me.onChange()
}
//or better yet
if (typeof me.onChange === "function") {
// safe to use the function me.onChange()
}