哪里錯(cuò)了呢
/定義"改變顏色"的函數(shù)
?var mychar=document.getElementById("tet");
?var set={
? ? ?changeColor:function(){
?mychar.style.color="red";
?mychar.style.backgroundColor="#ccc";
? ? ?},
//定義"改變寬高"的函數(shù)
? ? ?changeSize:function(){
? ? ? ? ?mychar.style.width=400px;
? ? ? ? ?mychar.style.height=500px;
? ? ?},
//定義"隱藏內(nèi)容"的函數(shù)
? ? ?Hide:function(){
? ? ? ? ?mychar.style.display="none";
? ? ?}
? ? ?
//定義"顯示內(nèi)容"的函數(shù)
? ? ?Show:function(){
? ? ? ? ?mychar.style.display="block";
? ? ?}
//定義"取消設(shè)置"的函數(shù)
? ? ?OffSet:function(){
? ? ? ? ?var message=confirm()
? ? ? ? ? ? ?if(message==true){
? ? ? ? ? ? ? ? ?txt.removeAttrjbute('style');
? ? ? ? ?}
? ? ?}
? }
2018-05-18
ById那該為txt吧,var set=后面這種寫法我還沒學(xué)過看不懂啊。