老師為什么點擊事后confirm那個確定框彈不出來
?<input type="button" value="取消設置" OnClick="chgSet">
function chgSet(){
??????? if(confirm("是否取消設置?"))
??????? {
??????? var p5 = document.getElementById("txt");
??????? p5.className = "set";
??????? };
}
?<input type="button" value="取消設置" OnClick="chgSet">
function chgSet(){
??????? if(confirm("是否取消設置?"))
??????? {
??????? var p5 = document.getElementById("txt");
??????? p5.className = "set";
??????? };
}
2016-03-07
舉報
2016-03-07
onclick="chgSet()"
2016-03-07
那個if的格式不對,應該是:
function chgSet(){
? ? var mychar=confirm("是否取消設置");
? ? if(mychar==ture){
? ? ? ? txt.removeAttribute('style');
? ? }
? ? else{
?? } ??
}
2016-03-07
你要把他屬性重新改過來啊