取消有問題
function Cancel()
{
? ? var sure=confirm("Are you sure?");
? ? if(sure==ture)
? ? {
? ? ? ? var can=document.getElementById('txt');
? ? ? ? can.style.color='#000';
? ? ? ? can.style.backgroundColor='#fff';
? ? ? ? can.style.display='block';
? ? ? ? can.style.width='400px';
? ? ? ? can.style.height='600px';
? ? }
}
為什么加個if判斷不起作用,去掉if既可以了?
2017-08-04
取消你可以使用:
var mychar = document.getElementById("txt");
?mychar.className="txt";
這個方法可以使所有樣式恢復原樣(我改變的是源代碼中id=“txt”的內容)
2017-08-04
你的方法也是可以的
2017-08-02
可以,我剛才試了