jq控制select值为某个时选中

$("#selectche_type option").each(function(){//用id  ,用class好像不得,不知道为何
                alert(2)
                if($(this).val()==che_type){
                    alert("jinlai")
                     $(this).attr("selected",true);
                }
 });

  

原文地址:https://www.cnblogs.com/weiyiyong/p/7742448.html