Answers for "contains .hasclass javascript"

6

javascript hass class

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

javascript hasclass

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