請(qǐng)大家?guī)臀铱纯?,我的取消設(shè)置按鈕為什么沒彈出確認(rèn)框。其他按鈕都實(shí)現(xiàn)
function clear(){
? ? var c=confirm("是否取消設(shè)置?");
? ? if(c==true)
? ? {
? ? ? ?text.removeAttribute("style");
? ? }
? ? else
? ? {
? ? ? ? alert("退出");
? ? }
}
function clear(){
? ? var c=confirm("是否取消設(shè)置?");
? ? if(c==true)
? ? {
? ? ? ?text.removeAttribute("style");
? ? }
? ? else
? ? {
? ? ? ? alert("退出");
? ? }
}
2016-10-04
舉報(bào)
2016-11-15
clear是JS的內(nèi)置函數(shù),不能作為函數(shù)名稱,換個(gè)名字就好,比如clear1
2016-10-08
直接寫成: ? txt.removeAttribute("style");
2016-10-04
有沒有onclick=“clear();”
2016-10-04
查看一下函數(shù)的調(diào)用是否正確,你給出的代碼是沒有問題的