Jquery部分--網頁特效 時間關係未寫完,等待更新

來源:互聯網
上載者:User

標籤:alert   option   選擇   --   對象   class   尋找   部分   更新   

一.尋找元素節點

1./*基本選取器,通過id,class元素尋找DOM對象*/

<div id="aa">111</div><div class="aa">222</div>

 

alert($("#aa").html());alert($(".aa").html());

2. /*層次選取器,尋找div中的p元素*/

<div><p>11</p></div>        <div><p>22</p></div>        <div><p>33</p></div>
/*$("div>p").html();   尋找div中的p元素  $("div p").html();*/ 尋找div中的p元素

3./*過濾選取器,例如尋找div中的第一個和最後一個元素,第一個div中的子項目和最後一個子項目*/

        <div>11</div>        <div>22</div>        <div>33</div>        <div>44</div>
       /*alert($("div:first").html());        alert($("div:last").html());        alert($("div:first-child").html());        alert($("div:last-child").html());*/

4./*表單選取器*/

<input type="radio" name="aa" id="aa" value="" />        <input type="radio" name="aa" id="aa" value="" />        <input type="checkbox" name="bb" id="bb" value="" />                <select name="aa">            <option value=""></option>        </select>-->
       /*$("input:checked").val();  擷取所有選中的單選和複選按鈕表單元素        $("select:selected").val(); 擷取下拉式功能表中被選中的value值*/

5.無需列表的選取

<ul>            <li>111</li>            <li>222</li>            <li>333</li>            <li>444</li>        </ul>
alert($("ul li:eq(1)").text());

二、

Jquery部分--網頁特效 時間關係未寫完,等待更新

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.