質問編集履歴

1

2020/09/09 03:43

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -30,7 +30,13 @@
30
30
 
31
31
  <p>サンプル
32
32
 
33
- <div class="hako" id="box" style="border: solid 1px black;width:100px;height:50px;"></div>
33
+ <div class="hako" id="box" style="border: solid 1px black;width:100px;height:50px;"></div>
34
+
35
+ <div class="hako1" id="box1" style="border: solid 1px black;width:100px;height:50px;"></div>
36
+
37
+
38
+
39
+ <div class="hako2"id="box2" style="border: solid 1px black;width:100px;height:50px;"></div>
34
40
 
35
41
  <input type="checkbox" onclick="hakoClick()">メニュー1
36
42
 
@@ -52,7 +58,7 @@
52
58
 
53
59
  function hakoClick1() {
54
60
 
55
- irobako = document.getElementById("box");
61
+ irobako = document.getElementById("box1");
56
62
 
57
63
  irobako.style.backgroundColor = "red";
58
64
 
@@ -62,7 +68,7 @@
62
68
 
63
69
  function hakoClick2() {
64
70
 
65
- irobako = document.getElementById("box");
71
+ irobako = document.getElementById("box2");
66
72
 
67
73
  irobako.style.backgroundColor = "blue";
68
74