1if (myElement.classList.contains('someClassname')) {
2 // do something
3}
1document.body.classList.add('thisClass');
2// $('body').addClass('thisClass');
3
4document.body.classList.remove('thatClass');
5// $('body').removeClass('thatClass');
6
7document.body.classList.toggle('anotherClass');
8// $('body').toggleClass('anotherClass');