1var element = document.getElementById('element');
2element.classList.add('class-1');
3element.classList.add('class-2', 'class-3');
4element.classList.remove('class-3');
1function myFunction() {
2 var element = document.getElementById("myDIV");
3 element.classList.add("mystyle");
4}
1var someElement= document.getElementById("myElement");
2 someElement.className += " newclass";//add "newclass" to element (space in front is important)