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

控制div樣式

original 2019-04-04 13:28:09 290
abstrait:<!DOCTYPE html><html>    <head>          <title>控制div樣式</title>       

<!DOCTYPE html>

<html>

    <head>

          <title>控制div樣式</title>

          <meta charset="utf-8">

          <style type="text/css">

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

          </style>

    </head>

<body>

  <script type="text/javascript">

            var qz

            window.onload=function(){

              qz=document.getElementById('box')

            }

            function aa(){

              qz.style.height="200px"

            }

            function bb(){

              qz.style.width="200px"

            }

            function cc(){

              qz.style.background="pink"

            }

            function dd(){

              qz.style.display ="none"

            }

            function ee(){

              qz.style.display="block"

            }

            function ff(){

              qz.style.height="100px"

              qz.style.width="100px"

              qz.style.background="#ccc"

            }

      </script>

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

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

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

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

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

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

      <input type="button" value="還原" onclick="ff()">

    </body>

</html>



Professeur correcteur:天蓬老師Temps de correction:2019-04-04 14:22:59
Résumé du professeur:js來動態(tài)的設(shè)置頁面中的所有元素的內(nèi)容,樣式等, 所以js功能強大, 不可濫用

Notes de version

Entrées populaires