class list add a class
Append a style class to the selected element. Use only the class name without the dot notation. 'add' method belongs to the 'classList' property.
element.classList.add('new-class-name');
copy