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

視頻案例的實現(xiàn)

原創(chuàng) 2019-05-22 16:10:40 226
摘要:DOM的作用就是改變html元素的內(nèi)容 ,如何操作就顯得至關(guān)重要,通過既定的函數(shù)找到需要操作的元素,再改變他的內(nèi)容,怎么找到這是需要深入理解和吃透的;<!DOCTYPE html><html><head> <title>javascript學(xué)習(xí)</title> <meta charset="utf-8">

DOM的作用就是改變html元素的內(nèi)容 ,如何操作就顯得至關(guān)重要,通過既定的函數(shù)找到需要操作的元素,再改變他的內(nèi)容,怎么找到這是需要深入理解和吃透的;

<!DOCTYPE html>

<html>

<head>

<title>javascript學(xué)習(xí)</title>

<meta charset="utf-8">

<link rel="icon" type="image/x-icon" href="static/images/favicon.ico">

<!-- <script type="text/javascript" src="static/a.js"></script> -->

<style type="text/css">

    *{margin: 5px;padding: 0;}

#box{

margin:20px 40px;

width: 200px;

height: 200px;

border:0 2px 2px;

background: #000;

}

button{

width: 50px;

height: 20px;

}


</style>

<script type="text/javascript">


var box;

window.onload=function(){

box=document.getElementById('box');

}

function a(){

box.style.height="400px";

}

function b(){

box.style.width="400px";

}

function c(){

box.style.background="skyblue";

}

function d(){

box.style.height="100px";

box.style.width="100px";

box.style.background="red";

}

function e(){

box.style.display="none";

}

function f(){

box.style.display="block";

}



</script>

</head>

<body>

<div>

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

<button onclick="a()">變高</button>

<button onclick="b()">變寬</button>

<button onclick="c()">背景色</button>

<button onclick="d()">重置</button>

<button onclick="e()">隱藏</button>

<button onclick="f()">顯示</button>

</div>




</body>

</html>


批改老師:查無此人批改時間:2019-05-23 13:18:58
老師總結(jié):完成的不錯。js功能非常強大,要好好練習(xí)。繼續(xù)加油。

發(fā)布手記

熱門詞條