<div class="codetitle"> <span><a style="CURSOR: pointer" data="80144" class="copybut" id="copybut80144" onclick="doCopy('code80144')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code80144"> <br><div> <br><form> <br><input name="a" tab="1"> <br><input name="a" tab="3"> <br><input name="a" tab="2"> <br><input name="a" tab="5"> <br><input name="a" tab="4"> <br><input type="submit" value="submit"> <br> </form> <br> </div> <br><script type="text/javascript"> <BR>var inputs = document.getElementsByTagName("input"); <BR>for (i = 0; i < inputs.length; i++) { <BR>inputs[i].onkeydown = function(e){ <BR>if (e.keyCode == 13) { <BR>var input = getInputByTab(parseInt(this.getAttribute("tab")) + 1); <BR>if (input) { <BR>input.focus(); <BR>return false; <BR>} <BR>} <BR>} <BR>} <BR>function getInputByTab(t) { <BR>for (i =0; i < inputs.length; i++) { <BR>if (inputs[i].getAttribute("tab") == t) <BR>return inputs[i]; <BR>} <BR>return false; <BR>} <BR></script> <br> </div>