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);
            }
        });

使用框架遇到的坑

posted @ 2018-07-10 10:56  enych  阅读(1861)  评论(0编辑  收藏  举报