I have several divs within the same form. What I am trying to do is to disable the Tab key in one of the divs in the form without disabl
div
Similar to Yipio, I added notab="notab" as an attribute to any element I wanted to disable the tab too. My jQuery is then one line.
notab="notab"
$('input[notab=notab]').on('keydown', function(e){ if (e.keyCode == 9) e.preventDefault() });
Btw, keypress doesn't work for many control keys.
keypress