回答編集履歴

1

はーいついきでーす

2018/08/22 18:09

投稿

bwz61366
bwz61366

スコア2009

test CHANGED
@@ -61,3 +61,59 @@
61
61
  </html>
62
62
 
63
63
  ```
64
+
65
+
66
+
67
+ ---
68
+
69
+ 追記
70
+
71
+ ```
72
+
73
+ <!DOCTYPE html>
74
+
75
+ <html>
76
+
77
+ <head>
78
+
79
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
80
+
81
+ <title>requiredチェック</title>
82
+
83
+ <meta charset="utf-8">
84
+
85
+ <meta name="viewport" content="width=device-width, initial-scale=1">
86
+
87
+ </head>
88
+
89
+ <body>
90
+
91
+ <form action="#" method="post">
92
+
93
+ <input id="id_name1" name="name" type="text" required>
94
+
95
+ <input id="id_name2" name="name" type="text" required>
96
+
97
+ <input id="id_name3" name="name" type="text" required>
98
+
99
+ <button type="button" id="id_button">requiredチェック</button>
100
+
101
+ </form>
102
+
103
+ <script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
104
+
105
+ <script>
106
+
107
+ $("#id_button").on("click", function () {
108
+
109
+ $(this).parent("form").get(0).reportValidity();
110
+
111
+ });
112
+
113
+ </script>
114
+
115
+ </body>
116
+
117
+ </html>
118
+
119
+ ```