How to add class to element in JavaScript

Last updated Nov 11, 2017
const element = document.querySelector('css-selector');

element.classList.add('class-name');