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

js改變css屬性

原創(chuàng) 2019-05-11 14:02:42 286
摘要:<!DOCTYPE html><html>             <head>             &nb

<!DOCTYPE html>

<html>

             <head>

                     <title></title>

                     <meta charset="utf-8">

                     <style type="text/css">

                     #box{

                     width:100px;height:100px;background:red;margin:20px 80px;

                     }           

                     </style>

             </head>

<body>

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

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

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

                 <input type="button" value="背景色" onclick="changebackground()">

                 <input type="button" value="改變形狀" onclick="changecicrl()">

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

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

                 <script type="text/javascript">

                 var box;

                 window.onload=function(){

                 box=document.getElementById('box');

                 }

                 function changeHeight(){

                 box.style.height="200px";

                 }

                 function changewidth(){

                 box.style.width="200px";

                 }

                 function changebackground(){

                 box.style.background='pink';

                 }

                 function changecicrl(){

                 box.style.borderRadius='50%';

                 }

                 function display(){

                 box.style.display='block';

                

                 }

                 function nodisplay(){

                 box.style.display='none';

                 }               

                 </script>




</body>

</html>


批改老師:查無此人批改時(shí)間:2019-05-13 09:33:18
老師總結(jié):完成的不錯(cuò)。js控制標(biāo)簽很方便,多練習(xí),對(duì)邏輯有幫助。繼續(xù)加油

發(fā)布手記

熱門詞條