this.parentNode.classList.toggle("open") code example
Example: classList has class
if (document.body.classList.contains('thatClass')) {
// do some stuff
}
if (document.body.classList.contains('thatClass')) {
// do some stuff
}