質問編集履歴
2
知りたいことを書いていなかった
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
jQueryのaddClassでクリックしたときに、クラスをつけたいのですが、現在は、下のコードのように今は同じようなjQueryのコードを2つ用意するといった効率の悪いコードの書き方をしています。
|
2
2
|
|
3
|
+
変数やfor文などでもっと効率のいい方法を探しています
|
4
|
+
|
3
5
|
inputのラジオボタンのbackgroundを選択した物だけ変えるようにしたいです。今回はcssの質問ではないので、cssのコードについては控えます。selectedを付けるとbackgroundの色が変わるものとします。
|
4
6
|
|
5
7
|
selectedの付け方は、ラジオボタンのような機能にしたいです。
|
1
コード変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,10 +14,10 @@
|
|
14
14
|
<label class="schoolgrade"><input type="radio" name="schoolgrade" value="6" required>小学6年生</label>
|
15
15
|
</div>
|
16
16
|
<div>
|
17
|
-
<label class="
|
17
|
+
<label class="schoolclass"><input type="radio" name="schoolclass" value="1" required>1組</label>
|
18
|
-
<label class="
|
18
|
+
<label class="schoolclass"><input type="radio" name="schoolclass" value="2" required>2組</label>
|
19
|
-
<label class="
|
19
|
+
<label class="schoolclass"><input type="radio" name="schoolclass" value="3" required>3組</label>
|
20
|
-
<label class="
|
20
|
+
<label class="schoolclass"><input type="radio" name="schoolclass" value="4" required>4組(</label>
|
21
21
|
</div>
|
22
22
|
```
|
23
23
|
jQuery
|