課程
/前端開發(fā)
/JavaScript
/JavaScript入門篇
如何使用confirm()確定框,來(lái)確認(rèn)是否取消設(shè)置。如是將恢復(fù)初始值。代碼怎么寫?
2016-08-17
源自:JavaScript入門篇 4-1
正在回答
document.getElementsByTagName("div")[0].removeAttribute("style");//定義"取消設(shè)置"的函數(shù)
function canle(){
? ? var c=confirm(“是否恢復(fù)初值”)
? ? if(c="true")
? ? txt.removeAttribute("style");
? ?
? ? }
removeAttribute("style")是回到原始屬性
//取消設(shè)置
? ? ? ? ? ? function num5(){
? ? ? ? ? ? ? ? var dom = confirm('是否取消設(shè)置');
? ? ? ? ? ? ? ? if(dom == true){
? ? ? ? ? ? ? ? ? ? mychar.style.cssText = null;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
舉報(bào)
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
3 回答使用confirm的方式
3 回答confirm的使用
1 回答confirm()的使用
3 回答confirm用法
1 回答有關(guān)confirm()用法
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-08-17
document.getElementsByTagName("div")[0].removeAttribute("style");//定義"取消設(shè)置"的函數(shù)
2016-08-17
function canle(){
? ? var c=confirm(“是否恢復(fù)初值”)
? ? if(c="true")
? ? txt.removeAttribute("style");
? ?
? ? }
removeAttribute("style")是回到原始屬性
2016-08-17
//取消設(shè)置
? ? ? ? ? ? function num5(){
? ? ? ? ? ? ? ? var dom = confirm('是否取消設(shè)置');
? ? ? ? ? ? ? ? if(dom == true){
? ? ? ? ? ? ? ? ? ? mychar.style.cssText = null;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }