回答編集履歴
1
修正
test
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
<script>
|
42
42
|
|
43
|
-
var i = 4;
|
43
|
+
var i = 4, s = "input[id^=text]";
|
44
44
|
|
45
45
|
$("#button1").on("click", function () {
|
46
46
|
|
@@ -52,11 +52,11 @@
|
|
52
52
|
|
53
53
|
|
54
54
|
|
55
|
-
$(document).on("keyup",
|
55
|
+
$(document).on("keyup", s, function (e) {
|
56
56
|
|
57
57
|
if (e.keyCode === 13) {
|
58
58
|
|
59
|
-
$(this).attr("id") === $(
|
59
|
+
$(this).attr("id") === $(s).eq(-1).attr("id") ? $(this).prevAll(s).eq(-1).focus() : $(this).nextAll(s).eq(0).focus();
|
60
60
|
|
61
61
|
}
|
62
62
|
|