這個是我打的代碼 運行不出效果...<input type="button" value="改變顏色" ?onclick='ys()'> ?? ? <input type="button" value="改變寬高" ?onclick='kg()'>? ? <input type="button" value="隱藏內(nèi)容" ? onclick='yc()'>? ? <input type="button" value="顯示內(nèi)容" onclick='xs()'>? ? <input type="button" value="取消設(shè)置" onclick='qx()'>? </form>? <script type="text/javascript">? var hh=document.getElementById('con');? var my=document.getElementById('txt');//定義"改變顏色"的函數(shù)function ys(){? ? hh.style.color='red';}//定義"改變寬高"的函數(shù)function kg(){my.style.width='100px'}//定義"隱藏內(nèi)容"的函數(shù)function yc(){? ? my.style.display='none'}//定義"顯示內(nèi)容"的函數(shù)function xs(){? ? my.style.display='block'}//定義"取消設(shè)置"的函數(shù)function qx(){? ? var mychose = confirm();? ? if(mychose==true){? ? ? ?mydiv.removeAttribute("style");? ? }別人的代碼
大佬 看看哪里不對 看了好多遍答案還是找不出T.T
阿鹿SAMA
2017-10-15 14:12:50