<style type="text/css">
#div1{
width:300px;
height:300px;
background-color:red;
}
</style>
<script type="text/javascript">
window.onload=function(){
function kkk(){
var obt=document.getElementById('div1');
obt.style.width='400px';
}
function kk(){
var obt=document.getElementById('div1');
obt.style.height='400px';
}
function kkkk(){
var obt=document.getElementById('div1');
obt.style.background='green';
}
}
</script>
</head>
<body>
<input type="button" value="变宽" onclick="kkk()" />
<input type="button" value="变高" onclick="kk()" />
<input type="button" value="变绿" onclick="kkkk()" />
<div id="div1">
</div>
</body>
</html>
添加回答
举报
0/150
提交
取消