? ? <input type="button" value="改變顏色" onclick="changecolor()"> ?? ? <input type="button" value="改變寬高" onclick="changewh()">? ? <input type="button" value="隱藏內(nèi)容" onclick="hiddencontent()">? ? <input type="button" value="顯示內(nèi)容" onclick="mydisplay()">? ? <input type="button" value="取消設(shè)置" onclick="set()">? </form>? <script type="text/javascript">? function changecolor(){? ? ? var changecolor=document.getElementById("txt");? ? ? changecolor.style.color="red";? ? ? changecolor.style.backgroundColor="blue";? }//定義"改變顏色"的函數(shù)? function changewh(){? ? ? var changewh=document.getElementById("txt");? ? ? changewh.style.width="1000px";? ? ? changewh.style.height="800px";? }//定義"改變寬高"的函數(shù)? function hiddencontent(){? ? ? var hiddencontent=document.getElementById("txt");? ? ? hiddencontent.style.display="none";? }//定義"隱藏內(nèi)容"的函數(shù)? function mydisplay(){? ? ? var mydisplay=document.getElementById("txt");? ? ? mydisplay.style.display="block";? }//定義"顯示內(nèi)容"的函數(shù)? function set(){? var myset=confirm("是否取消設(shè)置")? if(myset==true){? ? ? document.write( 'height:400px'+'width:600px'+"border:#333'+'solid 1px'+'padding:5px');? }? else{? ? ? document.write('changecolor()'+'changewh()'+'hiddencontent()'+'mydisplay()');? }? }
取消設(shè)置怎么沒有用啊 也沒有彈出確認(rèn)對話框
卟凌卟凌
2017-05-25 10:21:33