Capturing the tab key using JavaScript in Firefox

后端 未结 2 1595
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-20 19:22

I use the following to restricts user to enter only some characters. When I press tab, the cursor does not point to next control (in Mozilla). But it works fine in IE.

2条回答
  •  庸人自扰
    2020-12-20 20:17

    I would recommend trying e.keyCode instead of e.which. Here is a SO link that describes a good method of getting the key strike into a single variable regardless: jQuery Event Keypress: Which key was pressed?

提交回复
热议问题