append after elemnt code example
Example 1: jquery append after
<div class="container">
<h2>Greetings</h2>
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
</div>
<script>$( "<p>Test</p>" ).insertAfter( ".inner" );</script>
Example 2: append sibling javascript after first child
function insertAfter(newNode, referenceNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}