题目描述做一个改变div宽高背景色重置的项目题目来源及自己的思路在网上找了个高级的实现思路相关代码控制div属性#outer{width:500px;margin:0auto;padding:0;text-align:center;}#div1{width:100px;height:100px;background:black;margin:10pxauto;display:block;}varchangeStyle=function(elem,attr,value){elem.style[attr]=value};window.onload=function(){varoBtn=document.getElementsByTagName("input");varoDiv=document.getElementById("div1");varoAtt=["width","height","background","display","display"];varoVal=["200px","200px","red","none","block"];for(vari=0;i
添加回答
举报
0/150
提交
取消