直接用元素的classname属性指定即可。
Sample code:
document.getElementById("error-menu").className = "nav nav-list collapse in";
var liArr=document.getElementById("error-menu").getElementsByTagName("li");
liArr[1].className = "active";
END