【发布时间】:2016-05-31 07:16:45
【问题描述】:
在这里我想获取 allRefItems 但它应该被检查而不是禁用。但是在这里总是得到 所有ID的
var allRefItems = [];
$('table#reftable > tbody > tr').each(function () {
if ($(this).find('td:eq(0) input', this).is(':checked')) {
if ($(this).find('td:eq(0) input', this).not(':disabled')) {
itId = $(this).find('td:eq(0) input', this).attr('id');
allRefItems.push(itId);
}
}
});
【问题讨论】:
-
请添加标记,以便我们轻松复制。
-
你需要
if ($(this).find('td:eq(0) input').is(':not(:disabled)')) {或更好,只需使用$("input[type='checkbox']:checked:not(:disabled)")选择你想要的元素
标签: javascript jquery arrays asp.net-mvc