We are going to create a helper function like jQuery after(...)
or insertAfter(...)
.
Because jQuery already claimed insertAfter
, we'll use other term for the function name. Let's call it putAfter
.
In this, we actually will implement insertBefore
method.
It goes like this:
How to Use
That's all. Thanks for visiting.
References
-
insertBefore(...)
method on MDN -
jQuery documentations:
after(...)
method documentationinsertAfter(...)
method documentation
-
nodeType
property andNode.ELEMENT_NODE
: node type reference on MDN
Comments
Post a Comment