摘要:<!DOCTYPE html><html> <head> &nb
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<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="changeHeight()">
<input type="button" value="變寬" onclick="changewidth()">
<input type="button" value="背景色" onclick="changebackground()">
<input type="button" value="改變形狀" onclick="changecicrl()">
<input type="button" value="顯示" onclick="display()">
<input type="button" value="隱" onclick="nodisplay()">
<script type="text/javascript">
var box;
window.onload=function(){
box=document.getElementById('box');
}
function changeHeight(){
box.style.height="200px";
}
function changewidth(){
box.style.width="200px";
}
function changebackground(){
box.style.background='pink';
}
function changecicrl(){
box.style.borderRadius='50%';
}
function display(){
box.style.display='block';
}
function nodisplay(){
box.style.display='none';
}
</script>
</body>
</html>
批改老師:查無此人批改時(shí)間:2019-05-13 09:33:18
老師總結(jié):完成的不錯(cuò)。js控制標(biāo)簽很方便,多練習(xí),對(duì)邏輯有幫助。繼續(xù)加油