jq 指定下拉菜单 (option)某个值为选中状态

有的时候选择下拉菜单某个值提交表单后,页面的下拉菜单就变成了默认状态,为了记住选中的某个值,要把这个值设为选中状态,方法如下:
1 $("select[name='group']>option").each(function(){
2         if($(this).text() == aa){
3             $(this).attr('selected', 'selected')
4         }
5  });
原文地址:https://www.cnblogs.com/cuculus/p/7009778.html