1. 選択されたテキストを取得します:
$("#cusChildTypeId").find("option:selected").text();
$("#cusChildTypeId オプション : selected").text()
2. 選択された値を取得します:
$("#ddlRegType ").val();
3. 選択されたインデックスを取得します:
$("#ddlRegType ").get(0).selectedIndex;
4. 選択された項目の数を取得します
$("#cusChildTypeId").get(0).options.length
5. 選択されたインデックスを設定します:
$("#cusChildTypeId") .get(0) ).selectedIndex=index;//index はインデックス値
6. 選択した値を設定します:
$("#cusChildTypeId").attr(" value","通常");
$("#cusChildTypeId").val("通常");
$("#cusChildTypeId").get(0).value = "通常";
7. 選択したテキストを設定します:
1>.var count=$("#cusChildTypeId").get(0).options.length;
for(var i=0;i< ;count;i )
cusChildTypeId").get(0).options.selected = true;
休憩。
2>.$("#cusChildTypeId").val(text);
$("#cusChildTypeId").change();
8. 項目を追加します。表示内容はテキスト、値は value
$("#cusChildTypeId").get(0).options.add(new Option(text,value));
9. select
var count = $("#cusChildTypeId").size();
for(var i=0;i
}
}
10.
1> を選択します。 $("#cusChildTypeId").get(0).options.length = 0;