1var element = document.getElementById('element');
2element.classList.add('class-1');
3element.classList.add('class-2', 'class-3');
4element.classList.remove('class-3');
1// getting the target element
2var myElement = document.querySelector('#myElement');
3
4// example for addding some-class to the element
5myElement.classList.add('some-class');
6
7// multiple classes can be added like this
8myElement.classList.add('one-class', 'one-more-class');
9
10// example for removing any class from the element
11myElement.classList.remove('any-class');