abstract:<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title></title> <style type="text/css"> &n
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
#box{width: 100px; height: 120px;background: red;margin: 20px 80px;}
</style>
</head>
<body>
<script type="text/javascript">
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"
}
</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()">
</body>
</html>
Correcting teacher:天蓬老师Correction time:2019-04-10 17:21:29
Teacher's summary:改变dom元素的大小, 不一定要通过js, 用css就可以做到, 试着用js做一些更有趣的工作吧