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

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

Original 2019-02-15 00:09:28 331
abstract:<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>


Correcting teacher:查無(wú)此人Correction time:2019-02-15 09:19:22
Teacher's summary:完成的不錯(cuò)。js代碼,每行結(jié)束要加上 ; 號(hào)。要養(yǎng)成習(xí)慣,因?yàn)樯暇€的項(xiàng)目,需要把js文件壓縮,這樣用戶(hù)訪問(wèn)時(shí),請(qǐng)求的文件會(huì)小一些,速度快一些。繼續(xù)加油。

Release Notes

Popular Entries