Brad Walls Brad Walls - 10 months ago 62
jQuery Question

on tab hit show/hide

I have a script that shows a div onclick, however I want the same logic to occur when the user hits the tab button.


Can this function be used for a tab button? If so, how?


If you want to detect tab key from password field. You can try this:

$("#password").keydown(function (e) { 
  var keyCode = e.keyCode || e.which; 

  if (keyCode == 9) { 
    $("#password").trigger("click"); // trigger click event