日期:2014-05-16 浏览次数:20401 次
$("#id").find("option:selected").text();
$("#id").val();
$("#id").get(0).selectedindex;
$("#id").get(0).selectedIndex=1; //注意I大写
$("#id").attr("value","normal“);
$("#id").val("normal");
$("#id").get(0).value = value;
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_id").append("<option value='value'>text</option>"); //添加一项option
$("#select_id").prepend("<option value='0'>请选择</option>"); //在前面插入一项option
$("#select_id option:last").remove(); //删除索引值最大的option
$("#select_id option[index='0']").remove();//删除索引值为0的option
$("#select_id option[value='3']").remove(); //删除值为3的option
$("#select_id option[text='4']").remove(); //删除text值为4的option