当我使用JQuery.find时,哪个是“选择”选项列表的jQuery选择器

时间:2019-01-18 03:28:22

标签: javascript jquery html

我试图获取表内的select选项的值,所以我为每一行都做了一个,但是当我尝试获取select的值时,返回undefined。我想知道.find('select option')是否是.find()选择器的正确参数。我在下面发布代码。

$('#checklist tbody tr').each(function() {
    conceptos.push($(this).find("td").eq(0).html());
    if ($(this).find("td").eq(3).find('input[type="checkbox"]').is(':checked')) {
        conceptos.push(1);
    } else {
        conceptos.push(0);
    }
    //alert(JSON.stringify($(this).find("td").eq(4)));
    conceptos.push($(this).find("td").eq(4).find('select option').val());
});
alert(conceptos);

0 个答案:

没有答案