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

JavaScript控制DIV樣式

Original 2019-01-25 13:27:25 250
abstrakt:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=DIVDIV, initial-scale=1.0"><met

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=DIVDIV, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>JavaScript控制DIV樣式</title>

<style type="text/css">

#box{width: 100px;height: 100px;background:pink;margin:20px 60px;}

</style>

</head>

<body>

<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.background="red"//變成紅色

}

function dd(){

box.style.height="100px"

box.style.width="100px"

box.style.background="pink"

}

function ee(){

box.style.display="none"

}

function ff(){

box.style.display="block"

}

</script>

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

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

<INPUT TYPE="button" value="變寬"onclick=bb()></INPUT>

<INPUT TYPE="button" value="變色"onclick=cc()></INPUT>

<INPUT TYPE="button" value="重置"onclick=dd()></INPUT>

<INPUT TYPE="button" value="隱藏"onclick=ee()></INPUT>

<INPUT TYPE="button" value="顯示"onclick=ff()></INPUT>

</body>

</html>

Korrigierender Lehrer:天蓬老師Korrekturzeit:2019-01-25 15:15:45
Zusammenfassung des Lehrers:根據(jù)html5的標(biāo)準(zhǔn), 所以html標(biāo)簽,全部采用小寫, 以后不要用大寫了,盡管不區(qū)分

Versionshinweise

Beliebte Eintr?ge