UNPKG
@ungap/replace-children
Version:
latest (0.0.0)
0.0.0
A ParentNode.replaceChildren polyfill
github.com/ungap/replace-children
ungap/replace-children
@ungap/replace-children
/
index.js
7 lines
(6 loc)
•
180 B
JavaScript
View Raw
1
2
3
4
5
6
7
if
(!
document
.
replaceChildren
)
Node
.
prototype
.
replaceChildren
=
function
(
) {
this
.
textContent
=
''
;
if
(
arguments
.
length
)
this
.
append
.
apply
(
this
,
arguments
); };