jquery怎么设置select选中某项值?
//方法一://比如要选中值为aijquery的选项:$("#select").val("aijquery")
; //方法二:$("#select option[value='aijquery']").prop("selected","selected");在线实例演示:jquery动态选中select下拉框里指定值的optilon选项的两种方法及在线实例演示
怎么获得select下拉框的显示值?
引入jquery.js1 $("#selectid option:eq(1)").val(); 2 $("#selectid option").each(function(i){alert("第"+(i+1)+"个值为"+$(this).val());})
jqueryselect怎么设置,有默认的选中值,但是不能选择?
<body> <select id="select_disable"> <option value="1">1</option> <option value="2">1</option> <option value="3">1</option> <select></body>
<script>$("#select_disable").attr("disabled","disabled").css("background-color","#EEEEEE");</script>
用jquery的attr方法给select控件添加disabled属性
由于即使是被禁止选择了,下拉框还是会显示白色,这样可能会让用户产生 误解,可以再加上一个灰色的背景色