classList has class

JavaScript
if (document.body.classList.contains('thatClass')) {
    // do some stuff
} document.getElementById("myDIV").classList.add("mystyle"); 
Source

Also in JavaScript: