程序完全没反应,我找了好长时间错但是还是没用,求大神帮忙看看啊QAQ
</div>
<form>
<!--当点击相应按钮,执行相应操作,为按钮添加相应事件-->
<input type="button" value="改变颜色" ondick="set.changecolor()">
<input type="button" value="改变宽高"ondick="set.changewh()" >
<input type="button" value="隐藏内容" ondick="set.none()">
<input type="button" value="显示内容"ondick="set.block()" >
<input type="button" value="取消设置"ondick="set.quxiao()" >
</form>
<script type="text/javascript">
//定义"改变颜色"的函数
var txt=document.getElementById("txt");
var set={
chengecolor:function(){
txt.style.backgroundcolor="red";
txt.style.color="blue";
},
changewh:function(){
txt.style.width="500px";
txt.style.height="300px";
},
none:function(){
txt.style.display="none";
},
block:function(){
txt.style.display="block";
},
quxiao:function(){
var xiaoxi=confirm("确定要取消设置嘛?");
if(xiaoxi==true){
txt.removeAttribute('style');
}
}
}