取消設置的方法
要先設置函數最后一個不太好設置要用一個新的方法,然后把函數添加到
標簽中的onclick中引用函數。 //定義"取消設置"的函數 function quxiao(){ ? ? ? var a=document.getElementById("txt"); ? var b=confirm("確定取消全部設置嗎?"); ? ? ? ? ?if (b==true){ ? ? ? ? ? a.removeAttribute("style");//刪除屬性函數 ? ? ?//object.removeAttribute(屬性名); } else{}//設置空白,就相當于不設置 }
2016-07-15
function quxiao()
{
? ? ? var b;
? ? ? ?var a=document.getElementById("txt"); ? var b=confirm("確定取消全部設置嗎?"); ??
? ? ? ? if (b=true){ ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ? ?document.write("打開");
? ? ? ? ? ? ? ? ? ? ? ? b=prompt("http://www.xianlaiwan.cn/qadetail/152354?lastmedia=1")
? ? ? ? ? ? ? ? ? ? ? ? window.open('b',_blank);
? ? ? ? ? ? ? ? ? ? ? ? ?a.removeAttribute("style"); ? ??
? ? ? ? ? ? ? ? ? ? ? ? ?object.removeAttribute(屬性名);?
? ? ? ? ? ? ? ? }?
? ? ? ? ? ? else{
? ? ? ? ? ? ? ? ? document.write("關閉");? ? ? ? ? ? ??
}
?}
2016-07-15
<script>
function qxsz(){
??? var qxsz=confirm("確定取消設置嗎?");
??? if(qxsz==true){
??????? var wbys=document.getElementById("txt");
??????? wbys.style.cssText="none";
??? }
}
</script>