Dodaj wiele klas z tablicy JavaScript
const classArray = ["cl1", "cl2", "cl3"];
div.classList.add(...classArray);
Diz Andriana
const classArray = ["cl1", "cl2", "cl3"];
div.classList.add(...classArray);
document.getElementById("MyElement").className += " MyClass";