使用 Internet Explorer 双击复选框时出现问题
Problem with double click on checkbox with Internet Explorer
我想禁用双击 Internet Explorer 上的复选框。双击会导致函数出错(仅在 Internet Explorer 11 上)。
$('#editArchivesTable tbody').on('click', "input[type=checkbox]", function () { alreadySelected = $('#editArchivesTable tbody').find('input[type="checkbox"]:checked').parent('td').parent('tr').attr('choix(dataTable.row($(this).parent('td').parent('tr')).index(), $(this).is(':checked'))
});
$("#editArchivesTable tbody").bind('dblclick', "input[type=checkbox]", (function (event) {
event.preventDefault();
}));
我正在等待双击时不触发我的函数选项
For example, when double clicking on a checkbox, the value "85" is inserted twice in my list
使用 change
事件代替 click
事件。
在 change
事件中检查复选框的 状态 。
如果选中,则将值添加到数组中。如果不是,将其从数组中删除。
我想禁用双击 Internet Explorer 上的复选框。双击会导致函数出错(仅在 Internet Explorer 11 上)。
$('#editArchivesTable tbody').on('click', "input[type=checkbox]", function () { alreadySelected = $('#editArchivesTable tbody').find('input[type="checkbox"]:checked').parent('td').parent('tr').attr('choix(dataTable.row($(this).parent('td').parent('tr')).index(), $(this).is(':checked'))
});
$("#editArchivesTable tbody").bind('dblclick', "input[type=checkbox]", (function (event) {
event.preventDefault();
}));
我正在等待双击时不触发我的函数选项
For example, when double clicking on a checkbox, the value "85" is inserted twice in my list
使用 change
事件代替 click
事件。
在 change
事件中检查复选框的 状态 。
如果选中,则将值添加到数组中。如果不是,将其从数组中删除。