對嗎 為什么變不了
function a(){
?? ?????? var a = document.getElementById("p1");
?? ?????? p1.className="one"
?? ??? }
?? ??? function b(){
?? ?????? var b = document.getElementById("p2");
?? ???????? p2.className="two" ?
?? ??? }
對嗎? 為什么改變不了
function a(){
?? ?????? var a = document.getElementById("p1");
?? ?????? p1.className="one"
?? ??? }
?? ??? function b(){
?? ?????? var b = document.getElementById("p2");
?? ???????? p2.className="two" ?
?? ??? }
對嗎? 為什么改變不了
2015-07-22
舉報
2015-10-11
你設置了?var a = document.getElementById("p1"); ? ? ?那下面的?p1.className="one" 中的p1就要改為a??!
2015-07-22
<body>下邊的幾行你沒貼出來 我不確定是不是沒綁定單擊事件的問題