回答編集履歴
1
追記
test
CHANGED
@@ -10,7 +10,25 @@
|
|
10
10
|
|
11
11
|
});
|
12
12
|
|
13
|
-
|
13
|
+
});
|
14
|
+
|
15
|
+
```
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
# 追記
|
20
|
+
|
21
|
+
やっていることはほぼ同じですがfilterで処理すると
|
22
|
+
|
23
|
+
```javascript
|
24
|
+
|
25
|
+
$(function(){
|
26
|
+
|
27
|
+
$('.clr').filter(function(){
|
28
|
+
|
29
|
+
return $.inArray($(this).val(),$('.color').text().match(/[^\x20]+?\x20/g))>=0;
|
30
|
+
|
31
|
+
}).prop('checked',true);
|
14
32
|
|
15
33
|
});
|
16
34
|
|