JavaScript Div ID Agregar clase
var d = document.getElementById("div1");
d.className += " otherclass";
Shadow
var d = document.getElementById("div1");
d.className += " otherclass";
function myFunction2() {
var x = document.getElementsByClassName("menu-item-has-children")[0];
x.id="menu"
}