您的位置:首页 > Web前端 > JQuery

jQuery实现动态选中select

2017-03-31 19:40 459 查看
// jquery实现动态选中select

var active = $('.all_sla_title1 .active')
var group_name = active.html();
var sla = active.attr('data-sla');
var remote = active.attr('data-remote');
// console.log(group_name + sla + remote);
$.each($('#sla option'), function(i, n) {
if ($(n).val() == sla) {
$(n).attr("selected", true);
}
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: