how to know if a class is in classList code example
Example 1: if classlist contains js
element.classList.contains(class);
Example 2: classList has class
if (document.body.classList.contains('thatClass')) {
// do some stuff
}
element.classList.contains(class);
if (document.body.classList.contains('thatClass')) {
// do some stuff
}