abstrak:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> #box{ height: 100px; width: 100px; b
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
#box{
height: 100px;
width: 100px;
background-color: deeppink;
}
</style>
</head>
<body>
<div id="box">
</div>
<input type="button" value="改變高度"onclick="aa()" />
<input type="button" value="改變寬度"onclick="bb()" />
<input type="button" value="改變顏色" onclick="cc()" />
<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.backgroundColor = "blue"
}
</script>
</body>
</html>
Guru membetulkan:查無此人Masa pembetulan:2019-05-05 09:09:26
Rumusan guru:完成的不錯。js比較難,因為它的功能非常強大。繼續(xù)加油。 js每行語句最后增加;號。