為什么按鈕沒有反應(yīng)
?<script type="text/javascript">
//定義"改變顏色"的函數(shù)
??? function chColor(){
??????? var mycolor=document.getElementById("txt");
??????? mycolor.style.color="red"; ?
??? }
//定義"改變寬高"的函數(shù)
??? function chWH(){
??????? var myWH=document.getElementById("txt");
??????? myWH.style.width="400px";
??????? myWH.style.height="400px";
??? }
//定義"隱藏內(nèi)容"的函數(shù)
??? function chDis(){
??????? var myDis=document.getElementById("txt");
??????? myDis.style.display="none";
??? }
//定義"顯示內(nèi)容"的函數(shù)
??? function chDisp(){
??????? var myDis=document.getElementById("txt");
??????? myDis.style.display="block";
??? }
//定義"取消設(shè)置"的函數(shù)
??? function con(){
??????? var mysz=document.getElement("txt");
??????? var mymes=confirm("是否取消設(shè)置?");
??????? if(mymes==true){
??????????? mysz.style.color="black";
??????????? mysz.style.width="600px";
??????????? mysz.style.height="400px";
??????????? mysz.style.display="block";
??????? }else
??? }
? </script>
2019-02-22
按鈕要加點(diǎn)擊事件
<input type="button" value="改變顏色" onClick="chColor()">