Get all of the classes on an element as a string, add a class or classes, or completely replace or remove all classes.
var elem = document.querySelector('div');
// Get all of the classes on an element
var elemClasses = elem.className;
// Add a class to an element
elem.className += ' vanilla-js';
// Completely replace all classes on an element
elem.className = 'new-class';