回答編集履歴
1
JavaScriptを加えた
test
CHANGED
@@ -1,3 +1,59 @@
|
|
1
|
+
```HTML
|
2
|
+
|
3
|
+
<!DOCTYPE html>
|
4
|
+
|
5
|
+
<html lang="ja" xmlns:th="http://www.thymeleaf.org">
|
6
|
+
|
7
|
+
<head>
|
8
|
+
|
9
|
+
<meta charset="UTF-8">
|
10
|
+
|
11
|
+
<title>Insert title here</title>
|
12
|
+
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
|
16
|
+
|
17
|
+
<script th:src="@{/js/teacher.js}"></script>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<form th:action="@{/insert}" method="post">
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
<div id="parent">
|
28
|
+
|
29
|
+
名前<input type="text" name="teacherList[0].name" class="name"/>
|
30
|
+
|
31
|
+
科目<input type="text" name="teacherList[0].subject" class="subject"/>
|
32
|
+
|
33
|
+
</div>
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
<input type="button" value="追加" id="add">
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
<input type="submit" value="送信" />
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
</form>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
</body>
|
50
|
+
|
51
|
+
</html>
|
52
|
+
|
53
|
+
```
|
54
|
+
|
55
|
+
|
56
|
+
|
1
57
|
```JavaScript
|
2
58
|
|
3
59
|
$(function(){
|
@@ -80,6 +136,4 @@
|
|
80
136
|
|
81
137
|
```
|
82
138
|
|
83
|
-
|
84
|
-
|
85
139
|
このように記述したところ解決しました。
|