Answers for "plain js has class"

6

javascript hass class

if (myElement.classList.contains('someClassname')) {
    // do something
}
Posted by: Guest on December-11-2019
0

query selector has clas

if (document.body.classList.contains('thatClass')) {
    // do some stuff
}
Posted by: Guest on April-02-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language