<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> <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>inputs[i].onkeydown = function(e){ <br>if (e.keyCode == 13) { <br> var input = getInputByTab(parseInt(this.getAttribute("tab")) 1); <br>if (入力) { <br>input.focus(); <br> 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> false を返します。 <BR>} <BR></script> <br></inputs.length>