<div class="box" id="box"></div>
第一种方法
//设置属性
var a = document.getElementById("box");
a.setAttribute("style","width:100px;height:100px;background-color:red;")
第二种方法
a.style.width="200px";
a.style.height="200px";
a.style.backgroundColor="yellow"
第三种方法:css-Test形式
a.style.cssText="width:100px;height:100px;background-color:blue;"