6 lines
170 B
JavaScript
6 lines
170 B
JavaScript
// Use element.classList.add to add a class:
|
|
element.classList.add('my-class');
|
|
|
|
// And element.classList.remove to remove a class:
|
|
element.classList.remove('my-class');
|