取消设置!!!!
//定义"取消设置"的函数 function changeConfirm(){ styles = document.getElementById("txt"); var changes = confirm("确定取消设置吗?"); if(changes==true){ styles.removeAttribute("style"); }else{ document.write("取消操作"); } }
//定义"取消设置"的函数 function changeConfirm(){ styles = document.getElementById("txt"); var changes = confirm("确定取消设置吗?"); if(changes==true){ styles.removeAttribute("style"); }else{ document.write("取消操作"); } }
2018-03-09
var txt=document.getElementById("txt");
var set={
changeColor:function(){
txt.style.color="red";
txt.style.backgroundColor="#ccc";
},
changeSize:function(){
txt.style.width="300px";
txt.style.height="300px";
},
objHide:function(){
txt.style.display="none";
},
objShow:function(){
txt.style.display="block";
},
offSet:function(){
var message=confirm("你确定要重置所有设置么?");
if(message==true){
txt.removeAttribute('style');
}
}
}
举报