回答編集履歴
2
修正
test
CHANGED
@@ -18,6 +18,24 @@
|
|
18
18
|
|
19
19
|
});
|
20
20
|
|
21
|
+
```
|
21
22
|
|
22
23
|
|
24
|
+
|
25
|
+
# 修正
|
26
|
+
|
27
|
+
よくよく考えたらeachいらない?
|
28
|
+
|
29
|
+
```javascript
|
30
|
+
|
31
|
+
$(function(){
|
32
|
+
|
33
|
+
$("ul.form-list li:first-child input[type=radio]").prop("checked", true);
|
34
|
+
|
35
|
+
});
|
36
|
+
|
23
37
|
```
|
38
|
+
|
39
|
+
ただし、最初のliにかならずラジオボタンがあるとは限らないので調整が必要?
|
40
|
+
|
41
|
+
|
1
ソース追加
test
CHANGED
@@ -1,3 +1,23 @@
|
|
1
1
|
おなじnameを指定してグルーピングしないとラジオボタンとして
|
2
2
|
|
3
3
|
なんの体もなしていないと思いますがダイジョブですか?
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
# ソース追記
|
8
|
+
|
9
|
+
```javascript
|
10
|
+
|
11
|
+
$(function(){
|
12
|
+
|
13
|
+
$("ul.form-list").each(function(){
|
14
|
+
|
15
|
+
$("li:first-child input[type=radio]").prop("checked", true);
|
16
|
+
|
17
|
+
})
|
18
|
+
|
19
|
+
});
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
```
|