質問編集履歴
4
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -174,4 +174,68 @@
|
|
174
174
|
content: "\f3a7";
|
175
175
|
color: #17bcdf;
|
176
176
|
}
|
177
|
+
```
|
178
|
+
|
179
|
+
【追記】
|
180
|
+
上手く行きました!
|
181
|
+
|
182
|
+
```HTML
|
183
|
+
<!DOCTYPE html>
|
184
|
+
<html lang="ja">
|
185
|
+
<head>
|
186
|
+
<meta charset="UTF-8">
|
187
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
188
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
189
|
+
<title>ToDoリスト</title>
|
190
|
+
<link rel="stylesheet" href="css/styles.css">
|
191
|
+
|
192
|
+
</head>
|
193
|
+
<body>
|
194
|
+
<h1>ToDoリスト</h1>
|
195
|
+
|
196
|
+
<div class="radiobutton">
|
197
|
+
<input type="radio" id="button-1" name="radio1" value="1" checked />
|
198
|
+
<label for="button-1">すべて</label>
|
199
|
+
<input type="radio" id="button-2" name="radio1" value="2" />
|
200
|
+
<label for="button-2">完了中</label>
|
201
|
+
<input type="radio" id="button-3" name="radio1" value="3" />
|
202
|
+
<label for="button-3">作業中</label>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<h3 id="id_h3">ID コメント 状態</h3>
|
207
|
+
<h2>新規タスクの追加</h2>
|
208
|
+
|
209
|
+
|
210
|
+
<p id=id_p>
|
211
|
+
<input type="text" id="id_text" value="">
|
212
|
+
<button id="btn" type="btn" class="button"> 追加</button>
|
213
|
+
</p>
|
214
|
+
|
215
|
+
<script>
|
216
|
+
|
217
|
+
const btn = document.getElementById('btn');
|
218
|
+
btn.addEventListener('click', () => {
|
219
|
+
const text = document.getElementById('id_text').value;
|
220
|
+
const p1 = document.getElementById('id_p');
|
221
|
+
const p2 = document.getElementById('id_p');
|
222
|
+
const h2 = document.getElementById('id_h2');
|
223
|
+
|
224
|
+
//const button = <button id="btn" type="btn" class="button"> 作業中</button>
|
225
|
+
//const button = document.createElement('btn');
|
226
|
+
//btn.textContent = '作業中';
|
227
|
+
//document.body.appendChild(button);
|
228
|
+
|
229
|
+
p1.innerHTML("作業中");
|
230
|
+
p2.innerHTML("削除");
|
231
|
+
document.body.insertBefore(document.createTextNode(text), h2);
|
232
|
+
|
233
|
+
});
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
</script>
|
238
|
+
|
239
|
+
</body>
|
240
|
+
</html>
|
177
241
|
```
|
3
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -85,4 +85,93 @@
|
|
85
85
|
content: "\f3a7";
|
86
86
|
color: #17bcdf;
|
87
87
|
}
|
88
|
+
```
|
89
|
+
7
|
90
|
+
【追記】
|
91
|
+
リンク「<script src="https://unpkg.com/ionicons@4.5.10-0/dist/ionicons.js"></script>」をHTMLを挿入することで、ボタンはうまく反映されました。
|
92
|
+
|
93
|
+
サンプル通りのラジオボタンのコードはどのように検索すれば見つかるモノなのでしょうか?
|
94
|
+
検索は書けたのですが、見つからず途方に暮れています。
|
95
|
+
|
96
|
+
```HTML
|
97
|
+
<!DOCTYPE html>
|
98
|
+
<html lang="ja">
|
99
|
+
<head>
|
100
|
+
<meta charset="UTF-8">
|
101
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
102
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
103
|
+
<title>ToDoリスト</title>
|
104
|
+
<link rel="stylesheet" href="css/styles.css">
|
105
|
+
<link href="https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.min.css" rel="stylesheet">
|
106
|
+
</head>
|
107
|
+
<body>
|
108
|
+
<h1>ToDoリスト</h1>
|
109
|
+
|
110
|
+
<label>
|
111
|
+
<input type="radio" name="radio" class="radio" />
|
112
|
+
<span class="radio-icon"></span>
|
113
|
+
すべて
|
114
|
+
</label>
|
115
|
+
|
116
|
+
<label>
|
117
|
+
<input type="radio" name="radio" class="radio" />
|
118
|
+
<span class="radio-icon"></span>
|
119
|
+
作業中
|
120
|
+
</label>
|
121
|
+
|
122
|
+
<label>
|
123
|
+
<input type="radio" name="radio" class="radio" />
|
124
|
+
<span class="radio-icon"></span>
|
125
|
+
完了中
|
126
|
+
</label>
|
127
|
+
|
128
|
+
<h3 id="id_h3">IDコメント 状態</h3>
|
129
|
+
<h2>新規タスクの追加</h2>
|
130
|
+
|
131
|
+
<p>
|
132
|
+
<input type="text" id="id_text" value="">
|
133
|
+
<button id="btn" type="btn" class="button"> 追加</button>
|
134
|
+
</p>
|
135
|
+
|
136
|
+
|
137
|
+
<script>
|
138
|
+
const btn = document.getElementById('btn');
|
139
|
+
btn.addEventListener('click', () => {
|
140
|
+
const text = document.getElementById('id_text').value;
|
141
|
+
|
142
|
+
const h2 = document.getElementById('id_h2');
|
143
|
+
|
144
|
+
document.body.insertBefore(document.createTextNode(text), h2);
|
145
|
+
});
|
146
|
+
|
147
|
+
</script>
|
148
|
+
|
149
|
+
</body>
|
150
|
+
</html>
|
151
|
+
```
|
152
|
+
|
153
|
+
|
154
|
+
```CSS
|
155
|
+
.button:hover {
|
156
|
+
background-color: #59b1eb;
|
157
|
+
}
|
158
|
+
.button:active {
|
159
|
+
top: 3px;
|
160
|
+
box-shadow: none;
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
.radio {
|
165
|
+
display: none;
|
166
|
+
}
|
167
|
+
.radio + .radio-icon:before {
|
168
|
+
content: "\f3a6";
|
169
|
+
font-family: "Ionicons";
|
170
|
+
color: #ccc;
|
171
|
+
font-size: 22px;
|
172
|
+
}
|
173
|
+
.radio:checked + .radio-icon:before {
|
174
|
+
content: "\f3a7";
|
175
|
+
color: #17bcdf;
|
176
|
+
}
|
88
177
|
```
|
2
誤字
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
ボタンの設置が上手くいきません。
|
1
|
+
尹ボタンの設置が上手くいきません。
|
body
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
ラジオボタンを以下の形にしたいのですが、上手く設定できません。
|
2
2
|

|
3
|
-
https://gyazo.com/d2c1c87a05c786e2ded8873d13fd0a0d
|
3
|
+
[サンプル](https://gyazo.com/d2c1c87a05c786e2ded8873d13fd0a0d)
|
4
4
|
|
5
5
|
以下の記事を読みながら、作成したのですが、ボタンがつぶれたり、四角になってしまったりと上手くいきません。
|
6
6
|
[リンク内容](https://qiita.com/HikaruSasaki/items/36032eb90f28c1e59d0b)
|
1
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
ラジオボタンを以下の形にしたいのですが、上手く設定できません。
|
2
2
|

|
3
|
+
https://gyazo.com/d2c1c87a05c786e2ded8873d13fd0a0d
|
3
4
|
|
4
5
|
以下の記事を読みながら、作成したのですが、ボタンがつぶれたり、四角になってしまったりと上手くいきません。
|
5
6
|
[リンク内容](https://qiita.com/HikaruSasaki/items/36032eb90f28c1e59d0b)
|