是不是哪里出現有問題,并不能實現這幾個功能
var txt=document.getElementById("txt");
var set={
?function changcolor()
{txt.style.color="blue";
txt.style.backgroundColor="#ccc";},
function changSize()
{txt.style.width="600px";
txt.style.height="400px";},
function objHide()
{txt.style.display="none";},
function objShow()
{txt.style.display= "block";},
function offSet()
{var ans=confirm("是否取消?");
if (ans==true)
? ?{ txt.removeAttribute("style");}
}
}
2016-02-23
在input標簽里面缺乏 點擊觸發事件的部分?<input type="button" value="改變顏色" onclick="定義的函數"> 注意要函數要對應著寫 不要錯位了!如果還沒看明白 可以參考前面的 代碼看看