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