回答編集履歴
1
JavaScript only
test
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
```HTML
|
2
2
|
|
3
|
-
<input id="check"type="checkbox"name="check"onclick="hoge()"/>
|
3
|
+
<input id="check" type="checkbox" name="check" onclick="hoge()"/>
|
4
4
|
|
5
|
+
<label>同意する</label>
|
6
|
+
|
5
|
-
<button id="but"type="submit"disabled={isSubmitting}>登録</button>
|
7
|
+
<button id="but" type="submit" disabled={isSubmitting}>登録</button>
|
6
8
|
|
7
9
|
```
|
8
10
|
|
9
|
-
```
|
11
|
+
```JavaScript
|
10
12
|
|
11
|
-
|
13
|
+
function hoge() {
|
12
14
|
|
13
|
-
if(
|
15
|
+
if(document.getElementById('check').checked == true) {
|
14
16
|
|
15
|
-
|
17
|
+
document.getElementById('but').disabled = false;
|
16
18
|
|
17
|
-
|
19
|
+
} else {
|
18
20
|
|
19
|
-
else
|
21
|
+
document.getElementById('but').disabled = true;
|
20
22
|
|
21
|
-
|
23
|
+
}
|
22
24
|
|
23
|
-
|
25
|
+
}
|
24
|
-
|
25
|
-
});
|
26
26
|
|
27
27
|
```
|
28
28
|
|