亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

js入門篇最后一個綜合練習,求大神指點我錯在那

?var a1=document.getElementById("txt")

? function color(){

? ? ? a1.style.color="red";

? ? ? a1.style.backgroundColor="#ccc";

? }

? function width(){

? ? ? a1.style.height="300px";

? ? ? a1.style.width="200px";

? }

? function hide(){

? ? ? a1.style.display="none";

? }

? function display(){

? ? ? a1.style.display="block";

? }

? function confirm("確定要取消設置嗎?"){

? ? ??

? ? ?

? ? a1.style.height="400px";

? ? a1.style.width="600px";

? ? a1.style.border="#333 solid 1px";

a1.style.padding="5px";

? }


正在回答

2 回答

//定義"取消設置"的函數

function change_set(){

? ? var sse=confirm("取消設置?");

? ? if(sse==true){ ? ? ? ?

? ? ? ? var s=document.getElementById("con");

? ? ? ? s.removeAttribute("style");

var h=document.getElementById("txt");

h.removeAttribute("style");

? ? } ? else {

alert("取消了");

}?

}


0 回復 有任何疑惑可以回復我~

function confirm(){

? ? var a=confirm("是否取消設置");

? ? if(a==true){

? ? ? ? txt.style.color="auto";

? ? ? ? ?txt.style.width="600px";

? ? ? ? ? txt.style.height="400px";

? ? ? ? ? ?txt.style.display="block";

? ? ? ? ??? }

這里有個判斷,所以要加個if語句判斷,提示那里說確認了才恢復默認的,


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

js入門篇最后一個綜合練習,求大神指點我錯在那

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號