回答編集履歴
1
はーいついきでーす
answer
CHANGED
@@ -29,4 +29,32 @@
|
|
29
29
|
</script>
|
30
30
|
</body>
|
31
31
|
</html>
|
32
|
+
```
|
33
|
+
|
34
|
+
---
|
35
|
+
追記
|
36
|
+
```
|
37
|
+
<!DOCTYPE html>
|
38
|
+
<html>
|
39
|
+
<head>
|
40
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
41
|
+
<title>requiredチェック</title>
|
42
|
+
<meta charset="utf-8">
|
43
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
<form action="#" method="post">
|
47
|
+
<input id="id_name1" name="name" type="text" required>
|
48
|
+
<input id="id_name2" name="name" type="text" required>
|
49
|
+
<input id="id_name3" name="name" type="text" required>
|
50
|
+
<button type="button" id="id_button">requiredチェック</button>
|
51
|
+
</form>
|
52
|
+
<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
|
53
|
+
<script>
|
54
|
+
$("#id_button").on("click", function () {
|
55
|
+
$(this).parent("form").get(0).reportValidity();
|
56
|
+
});
|
57
|
+
</script>
|
58
|
+
</body>
|
59
|
+
</html>
|
32
60
|
```
|