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

這個東西很有趣,看了這個小米商城的匯總也做出來了。

original 2019-03-01 22:17:22 256
abstrait:<!DOCTYPE html><html><head> <title>DOM</title></head><body><p class="class1" id="id1">class1 這是一個P標簽 id1</p><p class="

<!DOCTYPE html>

<html>

<head>

<title>DOM</title>

</head>

<body>

<p class="class1" id="id1">class1 這是一個P標簽 id1</p>

<p class="class2" id="id2">class2 這是一個P標簽 id2</p>

<a href="www.baidu.com" name="na">www.baidu.com</a>


<form action="" name="na">

    <input type="text" name="username">

    <input type="password" name="password">

    <button name="button">提交</button>

</form>


<div onclick="function_id()">點擊對id1進行backgroundColor='red'操作</div>

<div onclick="function_n()">點擊對name進行backgroundColor='yellow'操作</div>

<div onclick="function_tag()">點擊對p標簽進行backgroundColor='blue'操作</div>

<div onclick="function_form0()">點擊對forms[0]標簽進行backgroundColor='lightgreen'操作</div>

<div onclick="function_link()">點擊對links[0].style.backgroundColor=#505050操作</div>

<div onclick="function_link1()">點擊對links['na'].style.backgroundColor='#900000'操作</div>

<div onclick="function_link2()">點擊對links.na.style.backgroundColor='#800000'操作</div>

<div onclick="function_link3()">點擊對links.item(0).style.backgroundColor='#100000'操作</div>

<script type="text/javascript">

function function_id() {

document.getElementById('id1').style.backgroundColor='red'

console.log(document.getElementById('id1'))

}


function function_n(){

document.na.style.backgroundColor='yellow'

}


function function_tag(){

    let a = document.getElementsByTagName('p')

for (let i=0;i<a.length;i++){

document.getElementsByTagName('p')[i].style.backgroundColor='blue'

}

}


function function_form0(){

document.forms[0].style.backgroundColor='lightgreen'

}


function function_link(){

document.links[0].style.backgroundColor='#505050'

}


function function_link1(){

document.links['na'].style.backgroundColor='#900000'

}

function function_link2(){

document.links.na.style.backgroundColor='#800000'

}

function function_link3(){

document.links.item(0).style.backgroundColor='#100000'

}

</script>





</body>

</html>


Professeur correcteur:滅絕師太Temps de correction:2019-03-02 09:19:46
Résumé du professeur:學習到的知識點最好是結合案例練習哦!便于記憶!

Notes de version

Entrées populaires