<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style>
#box{width: 100px;height:100px;background:blue;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="changeColor()">
<input type="button" value="重置" onclick="resetBox()">
<input type="button" value="隐藏" onclick="hideBox()">
<input type="button" value="显示" onclick="showBox()">
<script type="text/javascript">
var box;
window.onload=function(){
box=document.getElementById('box');
}
function changeHeight(){
box.style.height="400px";
}
function changeWidth(){
box.style.width="400px";
}
function changeColor(){
box.style.background="green";
}
function resetBox(){
box.style.height="100px";
box.style.width="100px";
box.style.background="blue";
}
function hideBox(){
box.style.display="none";
}
function showBox(){
box.style.display="block";
}
</script>
</body>
</html>