标签:style blog http color io os 使用 ar java
方法一:
$("#selIndustyType option[value=‘1‘]").attr("selected", "selected");
方法二:
<script type="text/javascript">
function change(objID, newValue) {
var obj = $("#" + objID);
if (!obj) {
alert("对象为空,执行返回!");
return;
}
var options = obj.find("option");
options.each(function (i) {
if ($(this).text() === newValue) {
$(this).attr("selected", true); -- 也可用 obj.get(0).selectedIndex = i; 替代
}
});
}
</script>
Jquery 根据value值设置下拉列表(select)默认选中项
标签:style blog http color io os 使用 ar java
原文地址:http://www.cnblogs.com/donchen/p/3999904.html