function css(target,styles){
for (var k in styles){
target.style[k]=styles[k];
}
示例:
var div = document.querySelector("div");
css(div,{300+"px",height: 400+"px",backgroundColor:green});