質問編集履歴
3
あいまいなのでHTML側も追加しました
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
2
あいまいなのでHTML側も追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
|
46
46
|
|
47
|
-
<div id="
|
47
|
+
<div id="id-1">
|
48
48
|
|
49
49
|
<img src="/assets/img/img-01.png">
|
50
50
|
|
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
|
54
54
|
|
55
|
-
<div id="
|
55
|
+
<div id="id-2">
|
56
56
|
|
57
57
|
<img src="/assets/img/img-02.png">
|
58
58
|
|
@@ -60,7 +60,7 @@
|
|
60
60
|
|
61
61
|
|
62
62
|
|
63
|
-
<div id="
|
63
|
+
<div id="id-3">
|
64
64
|
|
65
65
|
<img src="/assets/img/img-03.png">
|
66
66
|
|
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
|
70
70
|
|
71
|
-
<div id="
|
71
|
+
<div id="id-4">
|
72
72
|
|
73
73
|
<img src="/assets/img/img-04.png">
|
74
74
|
|
@@ -76,7 +76,7 @@
|
|
76
76
|
|
77
77
|
|
78
78
|
|
79
|
-
<div id="
|
79
|
+
<div id="id-5">
|
80
80
|
|
81
81
|
<img src="/assets/img/img-05.png">
|
82
82
|
|
@@ -132,11 +132,11 @@
|
|
132
132
|
|
133
133
|
|
134
134
|
|
135
|
-
document.getElements('
|
135
|
+
document.getElements('id-1','id-2','id-3').style.display ="none";
|
136
136
|
|
137
137
|
function clickBtn1(){
|
138
138
|
|
139
|
-
const p1 = document.getElements('
|
139
|
+
const p1 = document.getElements('id-1','id-2','id-3');
|
140
140
|
|
141
141
|
if(p1.style.display=="block"){
|
142
142
|
|
@@ -160,11 +160,11 @@
|
|
160
160
|
|
161
161
|
複数取得したいのです
|
162
162
|
|
163
|
-
document.getElementById("
|
163
|
+
document.getElementById("id-1").style.display ="none";
|
164
164
|
|
165
165
|
function clickBtn1(){
|
166
166
|
|
167
|
-
const p1 = document.getElementById("
|
167
|
+
const p1 = document.getElementById("id-1");
|
168
168
|
|
169
169
|
if(p1.style.display=="block"){
|
170
170
|
|
1
あいまいなのでHTML側も追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -11,6 +11,82 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
### 該当のソースコード
|
14
|
+
|
15
|
+
```ここに言語名を入力
|
16
|
+
|
17
|
+
// HTML
|
18
|
+
|
19
|
+
<a href="#">
|
20
|
+
|
21
|
+
<div onclick="clickBtn1()">
|
22
|
+
|
23
|
+
<img src="button01img.png" alt="01">
|
24
|
+
|
25
|
+
</div>
|
26
|
+
|
27
|
+
</a>
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
<a href="#">
|
32
|
+
|
33
|
+
<div onclick="clickBtn2()">
|
34
|
+
|
35
|
+
<img src="button02img.png" alt="02">
|
36
|
+
|
37
|
+
</div>
|
38
|
+
|
39
|
+
</a>
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
以下省略
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
<div id="p1">
|
48
|
+
|
49
|
+
<img src="/assets/img/img-01.png">
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<div id="p2">
|
56
|
+
|
57
|
+
<img src="/assets/img/img-02.png">
|
58
|
+
|
59
|
+
</div>
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<div id="p3">
|
64
|
+
|
65
|
+
<img src="/assets/img/img-03.png">
|
66
|
+
|
67
|
+
</div>
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
<div id="p4">
|
72
|
+
|
73
|
+
<img src="/assets/img/img-04.png">
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="p5">
|
80
|
+
|
81
|
+
<img src="/assets/img/img-05.png">
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
以下省略
|
88
|
+
|
89
|
+
```
|
14
90
|
|
15
91
|
|
16
92
|
|
@@ -75,3 +151,31 @@
|
|
75
151
|
}
|
76
152
|
|
77
153
|
```
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
```ここに言語名を入力
|
158
|
+
|
159
|
+
// ひとつのid名で取得は下記でできています。
|
160
|
+
|
161
|
+
複数取得したいのです
|
162
|
+
|
163
|
+
document.getElementById("p1").style.display ="none";
|
164
|
+
|
165
|
+
function clickBtn1(){
|
166
|
+
|
167
|
+
const p1 = document.getElementById("p1");
|
168
|
+
|
169
|
+
if(p1.style.display=="block"){
|
170
|
+
|
171
|
+
p1.style.display ="none";
|
172
|
+
|
173
|
+
}else{
|
174
|
+
|
175
|
+
p1.style.display ="block";
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
```
|