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