回答編集履歴
1
ちょうせい
test
CHANGED
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
```javascript
|
2
|
+
|
3
|
+
var str = "<div>要素1</div><div>要素2</div><div>要素3</div>";
|
4
|
+
|
5
|
+
var dummy=Object.assign(document.createElement('body'),{innerHTML:str});
|
6
|
+
|
7
|
+
console.log([...dummy.querySelectorAll('*')].map(x=>x.outerHTML));
|
8
|
+
|
9
|
+
```
|