JavaScript กด Enter แล้วเลื่อนไปช่องถัดไป

จดไว้กันลืม

<script language="JavaScript" type="text/javascript">
      function keyPressEnter(e,tbName) {
        if (e.keyCode == 13) {
              document.getElementById(tbName).focus();
        }
    }
</script>
<form name="frm" id="frm" action="#" method="post">
    <input type="text" name="t1" id="t1" onkeypress="keyPressEnter(event,'t2')">
    <input type="text" name="t2" id="t2" onkeypress="keyPressEnter(event,'t3')">
    <input type="text" name="t3" id="t3" onkeypress="keyPressEnter(event,'t4')">
    <input type="text" name="t4" id="t4" onkeypress="keyPressEnter(event,'t5')">
    <input type="text" name="t5" id="t5" onkeypress="keyPressEnter(event,'t6')">
</form>