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

jQuery ?? ???

?? jQuery? ?? ?????. jQuery? ? ????? ??? ?? ??? ??? ? ?? ??? ???? ???? ???? ?? ?????. ??? jQuery? ?? ???? ?? ?????.

jQuery? ?? ???? jQuery?? ?? ?? ???? ????? ?? ??? ?????? ???. ?? ??? ID, CLASS, ??? ?? ELEMENT? ?? ?????. ?. HTML? DOM ??. ? ????? ? ID ??? ? ?? ??? ? ??? ???? ????? ??? ? ????. jQuery ????????? ??? ?? ???? ???? ???? ??? ??? ? ???, ???? ?? ????? ?? ???????. ? ? ???? ?? ?? ??? HTML ?? ??? ?????.

<div id="mydiv">
    <div class="mini">我是一個(gè)名為mini的div標(biāo)簽</div>
    <div class="mini">我是一個(gè)名為mini的div標(biāo)簽</div>
    <div class="mini">我是一個(gè)名為mini的div標(biāo)簽</div>
    <p>我是一個(gè)段落p標(biāo)簽</p>
    <span>我是一個(gè)行內(nèi)span標(biāo)簽</span>
<div>

?? ?? ??? ?? ???? ?? ????? ?? ???????

1. ID ???

Selector: #id

??: ??? ID? ???? ??? ??

??: ?? ??

?:

<script type="text/javascript">    $(document).ready(function(){
        //id選擇器        $("#mydiv").css("background","#f96");
     });</script>

??: ID? mydiv

2? ??? ???? ?????. ??? ???

Selector: .class

??: ??? ??? ??? ???? ?? ??

??: ??? ??

?:

<script type="text/javascript">    $(document).ready(function(){
        //class選擇器        $(".mini").css("background","#f96");
     });</script>

??: ??? ?? mini

???? ?? ?? ??

???: element

??: ??? ?? ??? ???? ?? ??

??: ??? ??

?:

????

??:?? ??? <div>

Four? ?? ??? ???? ?????. ?? ??*

???: *

??: ???? ?? html ?? ??? ?????.

?? ?: ??? ??

?:

<script type="text/javascript">    $(document).ready(function(){
        //element選擇器        $("div").css("background","#f96");
     });</script>

??: ?? html ?? ??? ??? ??

5. selector1, selector2, .... selectorN

Selector: selector,selector2,...selectorN

??: ? ???? ???? ??? ???? ?? ?????.

??: ?? ??

?:

<script type="text/javascript">    $(document).ready(function(){
        //*選擇器        $("*").css("background","#f96");
     });</script>

??:??? ?? ? ?? p ??? ??? ??

???? ??
||
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title></title> <style> div { width: 100px; height: 90px; float: left; padding: 5px; margin: 5px; background-color: #EEEEEE; } </style> <script src="http://code.jquery.com/jquery-3.1.1.min.js"></script> </head> <body> <div id="aaron"> <p>id="aaron"</p> <p>選中</p> </div> <div id="imooc"> <p>id="php中文網(wǎng)"</p> <p>jQuery選中</p> </div> <div id="imooc"> <p>id="php中文網(wǎng)"</p> <p>jQuery未選中</p> </div> <script type="text/javascript"> //通過(guò)原生方法處理 var div = document.getElementById('aaron'); div.style.border = "3px solid blue"; </script> <script type="text/javascript"> //通過(guò)jQuery直接傳入id //id的唯一,只選擇到了第一個(gè)匹配的id為php中文網(wǎng)的div節(jié)點(diǎn) $("#imooc").css("border", "3px solid red"); </script> </body> </html>