var typeval =$("#xieyiguidflag").val();var seltype=$("#xieyiguid");seltype.find("option").each(function () { if ($(this).val()==typeval){ $(this).attr("selected",true) }});