按鍵沒有反應(yīng),大神請賜教
<script type="text/javascript">
? function changecolor(){
????? var mystr1=getElementById("txt");
????? mystr1.style.color="red";
????? mystr1.style.backgroundColor="blue";
? }
//定義"改變顏色"的函數(shù)
? function changesize(){
????? var mystr2=getElementById("txt");
????? mystr2.style.width="200px";
????? mystr2.style.height="100px";
? }
//定義"改變寬高"的函數(shù)
? function hidetext(){
?????
????? txt.style.display="none";
?????
? }
? function showtext(){
?????
????? txt.style.display="block";
? }
//定義"隱藏內(nèi)容"的函數(shù)
//定義"顯示內(nèi)容"的函數(shù)
? function cancelsetting(){
????? var mychar=confirm("are you sure to concel setting?");
????? if(mychar==true)
????? {? txt.removeAttribute("style");
? }
//定義"取消設(shè)置"的函數(shù)
2019-02-15
查看你的按鈕的onclick屬性
2019-02-15
你的document沒加,document.getElementById