abstract:<!DOCTYPE html> <html> <head> <title>ChangeDIV</title> <style type="text/css"> #box{width: 100px;height: 100px;background: re
<!DOCTYPE html> <html> <head> <title>ChangeDIV</title> <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="high()"> <input type="button" value="變寬" onclick="wdth()"> <input type="button" value="變色" onclick="clor()"> <input type="button" value="重置" onclick="rest()"> <input type="button" value="隱藏" onclick="hid()"> <input type="button" value="顯示" onclick="show()"> <script type="text/javascript"> var box window.onload=function(){ box=document.getElementById('box') } function high () { box.style.height="400px" } function wdth () { box.style.width = '400px' } function clor () { box.style.background = 'pink' } function rest () { box.style.height = '100px' box.style.width = '100px' box.style.background = 'red' } function hid () { box.style.display = 'none' } function show () { box.style.display = 'block' } </script> </body> </html>
Correcting teacher:滅絕師太Correction time:2018-12-14 13:13:48
Teacher's summary:小案例比較簡單,自己可以嘗試一些其他案例,鞏固學(xué)習(xí)奧!