function insertAfter(parentNode,newNode, refNode){ if(refNode.nextSibling) parentNode.insertBefore(newNode,refNode.nextSibling) else parentNode.appendChild(newNode) }