I want to capture the TAB keypress, cancel the default action and call my own javascript function.
Working example in jQuery 1.9:
$('body').on('keydown', '#textbox', function(e) { if (e.which == 9) { e.preventDefault(); // do your code } });