色www,五月婷婷深爱五月,午夜国产一级片,色噜噜综合,国产大胸无码视频,清纯美女被操黄网站在线观看,波多野结衣av高清一区二区三区

JQuery 獲取和設(shè)置Select選項(xiàng)的代碼

時(shí)間:2024-07-02 07:55:06 jQuery Mobile 我要投稿
  • 相關(guān)推薦

JQuery 獲取和設(shè)置Select選項(xiàng)的代碼精選

  獲取Select :

  獲取select 選中的 text :

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

  獲取select選中的 value:

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

  獲取select選中的索引:

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

  設(shè)置select:

  設(shè)置select 選中的索引:

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

  設(shè)置select 選中的value:

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

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

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

  設(shè)置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 獲取和設(shè)置Select選項(xiàng)的代碼】相關(guān)文章:

jquery提交按鈕的代碼07-28

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

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

關(guān)jQuery彈出窗口簡(jiǎn)單實(shí)現(xiàn)代碼-javascript編程06-07

jQuery 源碼分析和Ready函數(shù)06-28

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

ppt動(dòng)作按鈕設(shè)置和動(dòng)畫(huà)動(dòng)作設(shè)置12-06

Oracle查詢?cè)恚篠elect語(yǔ)句09-17

雙屏顯示器如何設(shè)置和設(shè)置技巧02-20

Oracle數(shù)據(jù)庫(kù)SELECT語(yǔ)句10-25