JavaScript div id add class

var d = document.getElementById("div1");
d.className += " otherclass";
Shadow