大家?guī)臀铱纯催@個取消為什么不能實(shí)現(xiàn)
我想用className來實(shí)現(xiàn)重置樣式,這段代碼問題點(diǎn)在哪?
<div id="txt" class="one">?
..............................
function reset(){
? ? var a5=confirm("要取消嗎?")
? ? if(a5==true){
? ? ? ? a5=document.getElementById("txt");
? ? ? ? a5.className="one";
? ? }
? ? else{?
? ? }
}//定義"取消設(shè)置"的函數(shù)
.one中已經(jīng)有設(shè)置好的樣式,但是就是不起作用
2018-08-25
變量賦值的那一行少了一個分號,程序會報錯的
2018-08-24
你的a5 怎么又是對象名又是confirm的名啊。。