第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

取消設(shè)置的思路問題 --我是把原來的初值一個個保存,有沒有一步到位保存所有數(shù)值的方法

我設(shè)置一個默認值,存儲原來的mychar的各項參數(shù),我試了下 默認值=mychar 然后??mychar=默認值 好像不行······


var mychar = document.getElementById("con");

? ? ? ? var 默認值

? ? ? ? 默認值.style.color = mychar.style.color;

? ? ? ? 默認值.style.backgroundColor = mychar.style.backgroundColor;

? ? ? ? 默認值.style.width = mychar.style.width;

? ? ? ? 默認值.style.height = mychar.style.height;

? ? ? ? 默認值.style.display = mychar.style.display;


正在回答

5 回答

使用removeAttribute("style")

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

<h2 id="con">JavaScript課程</h2>

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

???//定義變量保存默認值
???var color = txt.style.color;
???var backgroundColor = txt.style.backgroundColor;
???var width = txt.style.width;
???var height = txt.style.height;
???var block = txt.style.display;

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

???function cancelSet() {
????var message = confirm("取消設(shè)置?");
????if (message == true) {
?????txt.style.color = color;
?????txt.style.backgroundColor = backgroundColor;
?????txt.style.width = width;
?????txt.style.height = height;
?????txt.style.display = block;
????}
???}

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

用confirm函數(shù)

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

舉報

0/150
提交
取消

取消設(shè)置的思路問題 --我是把原來的初值一個個保存,有沒有一步到位保存所有數(shù)值的方法

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

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

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

公眾號

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