insert after a DOM element in a functional way.
npm install fd-insert-after --save
Let the DOM be like:
<div id="parentElement">
<span id="childElement">foo bar</span>
</div>```
```js
let insertAfter = require('fd-insert-after');
let sp1 = elem("span","meow")
,sp2 = document.getElementById("childElement")
,parentDiv = sp2.parentNode
insertAfter(sp1, sp2);
selectOne('#parentElement').children[0].innerText; // => 'foo bar'
insert-after :: refNode -> newNode
A curried function that takes in:
-
refNode The node after which newChild is inserted.
-
newChild The node to insert.