const element = document.querySelector("#box"); element.classList.add("class-name");
<div id="box"></div>