課程
/前端開(kāi)發(fā)
/JavaScript
/JavaScript入門(mén)篇
恢復(fù)原始值的代碼怎么寫(xiě)
2016-03-10
源自:JavaScript入門(mén)篇 4-1
正在回答
? function cancel(){
? ? ? var mychar=document.getElementById("txt");
? ? ? var message=confirm("確定取消所有設(shè)置?");
? ? ? if(message==true){
? ? ? ? ? mychar.removeAttribute("style");
? ? ? }
? ? ? else{
? ? ? ? ? alert("保留設(shè)置");
? }
window.load
function ds(){
? ? var ds=confirm("是否取消設(shè)置")
? ? if(ds==true){
? ? ? ? var ds=document.getElementById("txt");
? ? ? ? ds.removeAttribute("style")
? ? }
}
function?cancel(){ ????var?myId?=?document.getElementById("txt"); ????var?flag?=?confirm("是否取消設(shè)置?"); ????if?(flag) ????????myId.style.cssText?=?""; }
舉報(bào)
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門(mén)
5 回答JS中恢復(fù)原始值的代碼怎么寫(xiě)
4 回答怎么恢復(fù)原始值?
6 回答恢復(fù)原始值
2 回答如何恢復(fù)原始值
1 回答怎么將所有的設(shè)置都恢復(fù)原始值
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-03-11
? function cancel(){
? ? ? var mychar=document.getElementById("txt");
? ? ? var message=confirm("確定取消所有設(shè)置?");
? ? ? if(message==true){
? ? ? ? ? mychar.removeAttribute("style");
? ? ? }
? ? ? else{
? ? ? ? ? alert("保留設(shè)置");
? ? ? }
? }
2016-03-11
window.load
2016-03-10
function ds(){
? ? var ds=confirm("是否取消設(shè)置")
? ? if(ds==true){
? ? ? ? var ds=document.getElementById("txt");
? ? ? ? ds.removeAttribute("style")
? ? }
}
2016-03-10