<pre id="bbfd9"><del id="bbfd9"><dfn id="bbfd9"></dfn></del></pre>

          <ruby id="bbfd9"></ruby><p id="bbfd9"><mark id="bbfd9"></mark></p>

          <p id="bbfd9"></p>

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

            <th id="bbfd9"><form id="bbfd9"><dl id="bbfd9"></dl></form></th>

            <p id="bbfd9"><cite id="bbfd9"></cite></p><p id="bbfd9"></p>
            <p id="bbfd9"><cite id="bbfd9"><progress id="bbfd9"></progress></cite></p>

            JQuery 獲取和設置Select選項的代碼

            時間:2024-07-02 07:55:06 jQuery Mobile 我要投稿
            • 相關推薦

            JQuery 獲取和設置Select選項的代碼精選

              獲取Select :

              獲取select 選中的 text :

              $("#ddlRegType").find("option:selected").text();

              獲取select選中的 value:

              $("#ddlRegType ").val();

              獲取select選中的索引:

              $("#ddlRegType ").get(0).selectedIndex;

              設置select:

              設置select 選中的索引:

              $("#ddlRegType ").get(0).selectedIndex=index;//index為索引值

              設置select 選中的value:

              $("#ddlRegType ").attr("value","Normal“);

              $("#ddlRegType ").val("Normal");

              $("#ddlRegType ").get(0).value = value;

              設置select 選中的text:

              var count=$("#ddlRegType option").length;

              for(var i=0;i<count;i++)

              { if($("#ddlRegType ").get(0).options[i].text == text)

              {

              $("#ddlRegType ").get(0).options[i].selected = true;

              break;

              }

              }

              清空 Select:

              $("#ddlRegType ").empty();

            【JQuery 獲取和設置Select選項的代碼】相關文章:

            jquery提交按鈕的代碼07-28

            基于jQuery的固定表格頭部的代碼08-30

            jQuery(js)如何獲取文字寬度(顯示長度)09-29

            關jQuery彈出窗口簡單實現代碼-javascript編程06-07

            jQuery 源碼分析和Ready函數06-28

            jQuery中parent()和siblings()的問題10-16

            ppt動作按鈕設置和動畫動作設置12-06

            Oracle查詢原理:Select語句09-17

            雙屏顯示器如何設置和設置技巧02-20

            Oracle數據庫SELECT語句10-25

                    <pre id="bbfd9"><del id="bbfd9"><dfn id="bbfd9"></dfn></del></pre>

                    <ruby id="bbfd9"></ruby><p id="bbfd9"><mark id="bbfd9"></mark></p>

                    <p id="bbfd9"></p>

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

                      <th id="bbfd9"><form id="bbfd9"><dl id="bbfd9"></dl></form></th>

                      <p id="bbfd9"><cite id="bbfd9"></cite></p><p id="bbfd9"></p>
                      <p id="bbfd9"><cite id="bbfd9"><progress id="bbfd9"></progress></cite></p>
                      飘沙影院