質問編集履歴

1

誤字修正

2022/06/03 00:59

投稿

shin12t
shin12t

スコア25

test CHANGED
File without changes
test CHANGED
@@ -1,43 +1,45 @@
1
1
  ### input type="checkbox"でcheckedになった数を計測し、type="radio"では回答に応じて点数を与え、合計値を算出したい
2
2
  ```html
3
- <p>Bobが好きな乗り物はなんでしょう?</p>
3
+
4
4
  <div class="q1">
5
- <p>Q1</p>
5
+ <p>Bobが好きな乗り物はなんでしょう?</p>
6
+ <div>
6
- <input type="radio" id="bike" name="vehicle" value="2">
7
+ <input type="radio" id="bike" name="vehicle" value="1">
7
- <label for="bike">バイク(1点)</label>
8
+ <label for="bike">バイク(1点)</label>
8
- </div>
9
+ </div>
9
- <div>
10
+ <div>
10
- <input type="radio" id="scooter" name="vehicle" value="3">
11
+ <input type="radio" id="scooter" name="vehicle" value="2">
11
- <label for="scooter">スクーター(2点)</label>
12
+ <label for="scooter">スクーター(2点)</label>
12
- </div>
13
+ </div>
13
- <div>
14
+ <div>
14
- <input type="radio" id="car" name="vehicle" value="1">
15
+ <input type="radio" id="car" name="vehicle" value="3">
15
- <label for="car">車(3点)</label>
16
+ <label for="car">車(3点)</label>
16
- </div>
17
+ </div>
17
- <div>
18
+ <div>
18
- <input type="radio" id="train" name="vehicle" value="1">
19
+ <input type="radio" id="train" name="vehicle" value="1">
19
- <label for="train">電車(1点)</label>
20
+ <label for="train">電車(1点)</label>
21
+ </div>
20
22
  </div>
21
23
 
22
- <div class="q2">
24
+ <div class="q2" hidden>
23
- <p>Q2</p>
24
- <p>Bobが好きな色は何色でしょう?</p>
25
+ <p>Bobが好きな色は何色でしょう?</p>
26
+ <div>
25
- <input type="checkbox" id="black" name="color">
27
+ <input type="checkbox" id="black" name="color">
26
- <label for="black">黒</label>
28
+ <label for="black">黒</label>
29
+ </div>
30
+ <div>
31
+ <input type="checkbox" id="white" name="color">
32
+ <label for="white">白</label>
33
+ </div>
34
+ <div>
35
+ <input type="checkbox" id="blue" name="color">
36
+ <label for="blue">青</label>
37
+ </div>
38
+ <div>
39
+ <input type="checkbox" id="yellow" name="color">
40
+ <label for="yellow">黄色</label>
41
+ </div>
27
42
  </div>
28
- <div>
29
- <input type="checkbox" id="white" name="color">
30
- <label for="white">白</label>
31
- </div>
32
- <div>
33
- <input type="checkbox" id="blue" name="color">
34
- <label for="blue">青</label>
35
- </div>
36
- <div>
37
- <input type="checkbox" id="yellow" name="color">
38
- <label for="yellow">黄色</label>
39
- </div>
40
- <div>
41
43
  <button id="select">ポイント獲得数</button>
42
44
  </div>
43
45
  ```