<!DOCTYPE html>
<html >
<head>
<title></title>
</head>
<style type="text/css">
</style>
<body>
<input type="text" name="1">
<input type="text" name="2">
<input type="text" name="3">
<input type="text" name="44">
<input type="text" name="5">
</body>
<script type="text/javascript">
//按回车键跳到下一个input
var a=document.getElementsByTagName('input');
for (let i = 0; i < a.length; i++) {
a[i].onkeydown=function fn(e) {
console.log(e.keyCode);
// body...
if (e.keyCode==13) {
console.log(a[i+1])
a[i+1].focus();
}
}
}
</script>
</html>