最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

代碼差不多,為什么不行呢?

<form>

? <input type="button" value="改變顏色" onClick="dcolor()">

? <input type="button" value="改變寬高" onClick="dwh()">

? <input type="button" value="隱藏內(nèi)容" onClick="dh()">

? <input type="button" value="顯示內(nèi)容" onClick="ds()">

? <input type="button" value="恢復(fù)" onClick="dclear()">??

? </form>

? <script type="text/javascript">

function dcolor()

{? ?var mychar = document.getElementById("txt");

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

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

}

function dwh(){

? ?var mychar=document.getElementById("txt");

? ? mychar.style.width="300px";

? ? mychar.style.height="600px";

}

function dh(){

? ? var mychar=document.getElementById("txt");

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

}

function ds(){

? ? var mychar=document.getElementById("txt");

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

}

function dclear(){?

? ? var mm=confirm("是否恢復(fù)原始設(shè)置:");

? ? if(mm==true)

? ? { mydd.className="txt"; }

}

? </script>

</body>

</html>


正在回答

4 回答

function dclear(){?

? ? var mm=confirm("是否恢復(fù)原始設(shè)置:");

? ? if(mm==true)

? ? { mydd.className="txt"; }

}有問(wèn)題。



function dclear(){

? ? if(confirm("確定取消設(shè)置嗎?")){

? ? var mychar=document.getElementById("txt");

? ? mychar.style.color="#000";

? ? mychar.style.background="#fff";

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

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

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

? ? }

} ?用這個(gè)吧。至于原因,二樓說(shuō)的應(yīng)該是對(duì)的。


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

流星1981 提問(wèn)者

非常感謝!
2016-05-20 回復(fù) 有任何疑惑可以回復(fù)我~

換個(gè)瀏覽器試試,不同瀏覽器規(guī)則不同。


0 回復(fù) 有任何疑惑可以回復(fù)我~

<meta http-equiv="txttent-Type" txttent="text/html; charset=gb2312" />txttent是content,恢復(fù)原始數(shù)據(jù)的時(shí)候,用className沒(méi)有用,因?yàn)閖s設(shè)置的style比class的優(yōu)先,所以要去掉用mychar.removeAttribute("style");


1 回復(fù) 有任何疑惑可以回復(fù)我~

{}后未加分號(hào)

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

代碼差不多,為什么不行呢?

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)