UNPKG
@ungap/insert-after
Version:
latest (0.1.1)
0.1.1
0.1.0
A Node.prototype.insertAfter polyfill
github.com/ungap/insert-after
ungap/insert-after
@ungap/insert-after
/
esm
/
index.js
6 lines
(5 loc)
•
222 B
JavaScript
View Raw
1
2
3
4
5
6
/*! (c) Andrea Giammarchi - ISC */
if
(!(
'insertAfter'
in
Node.prototype)) Node.prototype.insertAfter =
function
insertAfter
(
node,
ref
)
{
return
this
.insertBefore(node,
ref
?
ref
.nextSibling :
this
.firstChild); };