I have some search fields on a page. Upon pressing ‘enter’ anything in these fields will then get filtered on for a dataset that’s displayed on a table.
$("document").on('keyup', (e) => {
if (e.keyCode === 13) {
searchAndDraw();
}
});
My issue is that I have a table #myTable
with some textareas
in td
s . Hitting ‘enter’ inside a textarea also triggers the search as the table is inside the document.
How can I apply this keyup
event to the doc but exclude #myTable
?
I tried $("document:not(#tliId)").on('keyup'...
but that does not work.