给一个HTML元素设置css属性,如var head= document.getElementById("head");head.style.width = "200px";head.style.height = "70px";head.style.display = "block";这样写太罗嗦了,为了简单些写个工具函数,如function setStyle(obj,css){ for(var atr in css){ obj.style[atr] = css[atr]; }}var head= document.getElementById("head");setStyle(head,{width:"200px",height:"70px",display:&...未完,继续阅读→