标签:javascript
jQuery 选择器$("p").css("background-color","red");
<html> <head> <script type="text/javascript" src="jquery-1.11.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(":header").css("background-color","grey"); $("div *").css("background-color","blue"); $("p *").css("background-color","purple"); $("p").css("background-color","yellow"); $("ul li:first").css("background-color","pink"); $("div#choose .introtoo").css("background-color","green"); }); </script> </head> <body> <html> <body> <h1>Welcome to My Homepage</h1> <p class="intro">My name is Donald</p> <p>I live in Duckburg</p> <p>My best friend is Mickey</p> <div id="choose"> <p class="introtoo">My name is Donald, too</p> Who is your favourite: <ul> <li>Goofy</li> <li>Mickey</li> <li>Pluto</li> </ul> </div> </body> </html> </body> </html>
My name is Donald
I live in Duckburg
My best friend is Mickey
My name is Donald, too
Who is your favourite:JavaScript(15)jQuery 选择器,布布扣,bubuko.com
标签:javascript
原文地址:http://blog.csdn.net/u014194675/article/details/25990357