jq遍历 下拉框

 var selectA1 = $("select[name=A1]"); //从A1下拉框中 搜索值
        $(selectA1).children("option").each(function () {
            //console.log(this.index);
            //console.log($(this).text());//每一个option
            if ($(this).text() === A1) {
                $("select[name=A1]").find('option:eq('+this.index+')').attr('selected', true);
            }
        });

使用框架遇到的坑

猜你喜欢

转载自www.cnblogs.com/enych/p/9287873.html