jquery设置select选中项

来源:互联网 发布:php调用python脚本 编辑:程序博客网 时间:2024/06/06 00:49
var value="***";$("select").children("option").each(function(){               var temp_value = $(this).val();              if(temp_value == value){                    $(this).attr("selected","selected");              }         });
或者如下
 $("select option[value='"+value+"']").attr("selected", "selected");


2 0