<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [toc] ### 1. 捕獲 ``` alert("text:"+$("#text").text()); alert("text:"+$("#text").html()); //會獲取內部子標簽 alert("text:"+$("#name").val()); //獲取輸入框value(內容) alert("text:"+$("#aid").attr("href")); //獲取a標簽的href屬性 ``` ### 2. 設置 ``` $("#btn1").click(function(){ $("#p1").text("極客學院"); //更改p標簽的內容 }); ``` ``` $("#btn2").click(function(){ $("#p2").html("<a href='https://www.baidu.com'>極客學院</a>"); //更改p標簽的內容,帶有新的標簽 }) ``` ``` $("#btn4").click(function(){ $("#aid").attr("href", "https://www.jikexueyuan.com"); //更改a標簽的屬性值 }) ``` ``` //更改元素的多個屬性值 $("#btn4").click(function(){ $("aid").attr({ "href": "https://www.jikexueyuan.com", //逗號隔開 "title": "hello" }) }) ``` ``` //以上函數均可實現回調 $("#btn5").click(function(){ $("#p5").text(function(i, ot){ return "old: " +ot+ " new:這整段話包括前面都是return的新內容"; }) }) ``` ### 3. 添加元素 1. 添加元素內容 ``` $(function(){ $("#btn1").click(function(){ // $("#p1").append("this is my webpage add content"); //添加內容到元素內容之后 $("#p1").prepend("this is my webpage add content"); //添加內容到元素內容之前 }) $("#btn2").click(function(){ $("#p2").before("hello"); //添加內容到元素內容之前,換行 $("#p2").after("hello"); //添加內容到元素內容之后,換行 }) }) ``` 2. 添加元素以及元素內容 ``` function appendText() { /* html、jQuery、DOM 三種方式*/ var text1 = "<p>iwen</p>" var text2 = $("<p></P>").text("ime"); var text3 = document.createElement("p"); text3.innerHTML = "acely"; $("body").append(text1, text2, text3); } ``` ### 4. 刪除元素 ``` $(function(){ $("#btn").click(function(){ $("#div").remove(); //全部刪除 // $("#div").empty(); //刪除里面的子元素與內容 }) }) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看