abstract:<!DOCTYPE html> <html> <head> <title>dom_demo7zuoye</title> </head> <body> <p>text01</p> <p>text02</p> <p id="tt
<!DOCTYPE html> <html> <head> <title>dom_demo7zuoye</title> </head> <body> <p>text01</p> <p>text02</p> <p id="tt">text03</p> <p>text4</p> <p>text5</p> <input type="button" value="test1" onclick="doit()"> <body> <script type="text/javascript"> //var vt1; // function doit() { var vt2,vt3,vt4; var vt1 = document.querySelectorAll("p"); console.log(vt1); vt1[0].style.backgroundColor="red"; console.log(vt1.item(1)); vt1.item(1).style.color="blue"; vt2 = document.querySelector("#tt"); console.log(vt2); vt2.style.fontSize = "30px"; // vt2 = //alert("hello"); } </script> </html>
css選擇器 選擇標(biāo)簽 改變樣式
Correcting teacher:滅絕師太Correction time:2019-01-24 14:54:22
Teacher's summary:完成的不錯(cuò),作業(yè)可以嘗試案例哦,用到實(shí)際中去