The reason is that when you click the tab, two actions are performed
- KeyUp button for tabs
- Blur action for Input Type field
Now, according to your code, you add an eventlistner to blur the event ... and the blur event has no property to give you a key binding.
So, for this you need to bind "keydown".
$("input").keydown(function (e) { if (e.which == 9) alert("YEYYYYYYY!!!"); });
source share