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