2021-01-13 19:25:27
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="http://wx/res/js/jquery1.8.js"></script>
</head>
<body>
<div id="box">
<input type="text" value="1" name="" />
<br />
<input type="text" value="2" name="" />
<br />
<input type="text" value="3" name="" />
<br />
<input type="text" value="4" name="" />
<br />
</div>
<script>
$(document).ready(function(e) {
var p = 0, input = $('input');
input.on('focus', function(f) {
p = input.index(this);
});
$(document).on('keypress', function(e) {
if(e.which === 13) {
p++;
if(p >= input.length) {
p = 0;
}
input.eq(p).focus();
}
});
input.get(0).focus();
});
</script>
</body>
</html>
2021-08-03 13:58:31
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("body").children("input:text")[0].focus();
});
$(document).keydown(function (event) {
if (event.keyCode == 13) {
$('*:focus').next("input:text").focus();
}
});
</script>
</head>
<body>
<input type="hidden" id="hf" name="hf" value="0" />
<input type="text" id="txt1" name="txt1" />
<input type="text" id="txt2" name="txt2" />
<input type="text" id="txt3" name="txt3" />
<input type="text" id="txt4" name="txt4" />
<input type="text" id="txt5" name="txt5" />
</body>
</html>
2020-09-28 03:34:02
2022-01-25 20:39:57