I'm trying to trigger an event if any key is pressed except the arrows keys or the enter key on a text input field.
myinput.addEventListener('keydown', (e) => {
if (e.keyCode !== 13 ||
e.keyCode !== 37 ||
e.keyCode !== 38 ||
e.keyCode !== 39 ||
e.keyCode !== 40 ) {
console.log('foo');
}
});
In the above example, my if is ignored and 'foo' appears for every key.
Any idea what I am doing wrong?