javascript check if element has class

JavaScript
if(document.getElementById("myElmentID").classList.contains("hidden")){
// I have the 'hidden' class
}
Source

Also in JavaScript: