回答編集履歴
2
調整
test
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
|
43
43
|
$(function(){
|
44
44
|
|
45
|
-
|
45
|
+
$('div').filter(function(){
|
46
46
|
|
47
47
|
return $(this).text().length>0;
|
48
48
|
|
1
追記
test
CHANGED
@@ -21,3 +21,43 @@
|
|
21
21
|
|
22
22
|
|
23
23
|
ただし、改行マークやタブなどもカウントされます
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
# 追記
|
28
|
+
|
29
|
+
よくみたらピックアップしてCSSを書き換えるんでしたっけ。
|
30
|
+
|
31
|
+
であればこんな感じで。
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
```CSS
|
36
|
+
|
37
|
+
div{width:100px;height:20px; background-Color:yellow}
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
```javascript
|
42
|
+
|
43
|
+
$(function(){
|
44
|
+
|
45
|
+
var n=$('div').filter(function(){
|
46
|
+
|
47
|
+
return $(this).text().length>0;
|
48
|
+
|
49
|
+
}).css({'background-Color':'red'});
|
50
|
+
|
51
|
+
});
|
52
|
+
|
53
|
+
```
|
54
|
+
|
55
|
+
```HTML
|
56
|
+
|
57
|
+
<div>aaa</div>
|
58
|
+
|
59
|
+
<div>aaa<span>bbb</span>ccc</div>
|
60
|
+
|
61
|
+
<div></div>
|
62
|
+
|
63
|
+
```
|