How to force “enter key” to act as “tab key” using javascript?
问题 I'm working on a site that is full of forms to be filled and I it's required that when escape button is pressed focus move to the next input control, just as pressing "tab" do. I found code to move focus when keypressed is 13 but this need to take the ID of element to focus on <input id="Text1" type="text" onkeydown="return noNumbers(event)" /> <input id="Text2" type="text" /> <script type="text/javascript"> function noNumbers(e) { keynum = e.which; if (keynum == 13) document.getElementById(