回答編集履歴
1
テキスト修正
answer
CHANGED
@@ -3,13 +3,15 @@
|
|
3
3
|
以下でどうでしょう?
|
4
4
|
|
5
5
|
```javascript
|
6
|
-
$(".wrap")
|
6
|
+
$(".wrap")
|
7
|
+
.contents()
|
8
|
+
.filter(
|
7
9
|
function() {
|
8
|
-
return this.nodeType ===
|
10
|
+
return this.nodeType === Node.TEXT_NODE;
|
9
11
|
}
|
10
12
|
).wrap(
|
11
13
|
function(i) {
|
12
|
-
return `<div class="txt${i+1}"/>`
|
14
|
+
return `<div class="txt${i+1}"/>`;
|
13
15
|
}
|
14
16
|
);
|
15
17
|
```
|