亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

JS 變換按鈕及函數(shù)

オリジナル 2019-02-15 00:09:28 331
サマリー:<head><style type="text/css">#box{width: 100px;height: 100px;background:bisque}</style></head><body><div id="box"></div>   

<head>

<style type="text/css">

#box{width: 100px;height: 100px;background:bisque}



</style>


</head>

<body>

<div id="box"></div>

    <input type="button" value="變高" onclick="Alterheight()">

    <input type="button" value="變寬" onclick="Alterwidth()">

    <input type="button" value="變色" onclick="Altercolor()">

    <input type="button" value="重置" onclick="Reset()">

    <input type="button" value="隱藏" onclick="Hide()">

    <input type="button" value="顯示" onclick="Display()">


<script type="text/javascript">

    var box

    window.onload = function(){

            box = document.getElementById('box')

    }

    function Alterheight(){

            box.style.height = '500px'

    }

    function Alterwidth(){

            box.style.width = "500px"

     }

     function Altercolor(){

            box.style.background = "red";

        }

    function Reset(){

            box.style.height="100px";

            box.style.width="100px";

            box.style.background="bisque";

        }

    function Hide(){

            box.style.display="none"


        }

     function Display(){

            box.style.display="block"


}


</script>


</body>


添削の先生:查無此人添削時間:2019-02-15 09:19:22
先生のまとめ:完成的不錯。js代碼,每行結(jié)束要加上 ; 號。要養(yǎng)成習慣,因為上線的項目,需要把js文件壓縮,這樣用戶訪問時,請求的文件會小一些,速度快一些。繼續(xù)加油。

手記を発表する

人気のある見出し語