记录jq控制select 选中状态

$("#categoryId option[value='"+ data.category_id +"']").attr("selected",
true
);
$('#categoryId option:contains(' + data.category_name + ')').each(function(){
      f ($(this).text() == data.category_name) {
          $(this).attr('selected', true);
    }
 });

posted on 2017-11-09 10:33  忘忧很努力呀~  阅读(262)  评论(0)    收藏  举报