サマリー:<!doctype html><html> <head> <title>js改變css效果</title> &n
<!doctype html>
<html> <head> <title>js改變css效果</title> <style> *{margin:0px;padding:0px} #box{width:100px;height:100px;background:red;margin:40px 60px;} </style> </head> <body> <div id="box"><div> <input type="button" value="變高"> <input type="button" value="變寬"> <input type="button" value="變色"> <input type="button" value="重置"> <input type="button" value="消失"> <input type="button" value="隱藏"> <script> var box window.onload = function(){ box = document.getElementById("box"); } function aa(){ box.style.height="400px;" //變高 } function bb(){ box.style.width="400px;" //變寬 } function cc(){ box.style.background="pink;"//變色 } function dd(){ box.style.height="100px;" box.style.width="100px;" //chongzhi box.style.background="red;" } function ee(){ box.style.display = "none" //消失 } function ff(){ box.style.display = "block" //顯示 } </script> </body> </html>
添削の先生:滅絕師太添削時間:2019-03-18 09:24:35
先生のまとめ:完成的不錯,除了上課練習,可以結(jié)合實際案例擴展!