亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

使用js來控制css樣式

Original 2019-01-24 10:18:34 287
abstract:<html><head> <meta charset='utf-8'>    <style> #box{ width:100px; height:100px; background:red; margin: 20px 80px; }    </style></h

<html>

<head>

<meta charset='utf-8'>

    <style>

#box{

width:100px; height:100px;

background:red;

margin: 20px 80px;

}

    </style>

</head>

<body>

<div id="box"></div>

<input onclick="aa()" type="button" value="變高">

<input onclick="bb()" type="button" value="變寬">

<input onclick="cc()" type="button" value="變色">

<input onclick="dd()" type="button" value="重置">

<input onclick="ee()" type="button" value="顯示">

<input onclick="ff()" type="button" value="隱藏">

</body>

</html>

<script>

var box 

window.onload = function(){

box = document.getElementById('box')

}


function aa(){

box.style.height = '350px'

}


function bb(){

box.style.width = '400px'

}


function cc(){

box.style.background = 'blue'

}


function dd(){

box.style.height='100'

box.style.width='100'

box.style.background='red'

}


function ee(){

box.style.display = 'block'

}


function ff(){

box.style.display = 'none'

}

</script>


Correcting teacher:滅絕師太Correction time:2019-01-24 10:23:38
Teacher's summary:完成的不錯,寫出來的每一行代碼都要知道代碼的作用哦!

Release Notes

Popular Entries