how to add class name to tag javascript code example Example: javascript give class to element element.classList.add("div-class");