回答編集履歴
1
途中で投稿されたので
answer
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
DocumentFragment を作って置き換えます。
|
1
2
|
```jQuery
|
2
3
|
var original = $('.printpage');
|
3
4
|
var fragment = document.createDocumentFragment();
|
@@ -11,6 +12,7 @@
|
|
11
12
|
|
12
13
|
fragment.removeChild(fragment.lastChild);
|
13
14
|
original.replaceWith(fragment);
|
15
|
+
```
|
14
|
-
|
16
|
+
[https://developer.mozilla.org/ja/docs/Web/API/DocumentFragment](https://developer.mozilla.org/ja/docs/Web/API/DocumentFragment)
|
15
17
|
[https://api.jquery.com/slice/](https://api.jquery.com/slice/)
|
16
18
|
[https://api.jquery.com/replaceWith/](https://api.jquery.com/replaceWith/)
|