tinymce.full.js
function (node, referenceNode) {
        referenceNode = this.get(referenceNode);

        return this.run(node, function (node) {
          var parent, nextSibling;

          parent = referenceNode.parentNode;
          nextSibling = referenceNode.nextSibling;

          if (nextSibling) {
            parent.insertBefore(node, nextSibling);
          } else {
            parent.appendChild(node);
          }

          return node;
        });
      }
function (node, referenceNode) {
        referenceNode = this.get(referenceNode);

        return this.run(node, function (node) {
          var parent, nextSibling;

          parent = referenceNode.parentNode;
          nextSibling = referenceNode.nextSibling;

          if (nextSibling) {
            parent.insertBefore(node, nextSibling);
          } else {
            parent.appendChild(node);
          }

          return node;
        });
      }
function ( node , referenceNode ) { referenceNode = this . get ( referenceNode ) ; return this . run ( node , function ( node ) { var parent , nextSibling ; parent = referenceNode . parentNode ; nextSibling = referenceNode . nextSibling ; if ( nextSibling ) { parent . insertBefore ( node , nextSibling ) ; } else { parent . appendChild ( node ) ; } return node ; } ) ; }
Inserts an element after the reference element.

@method insertAfter
@param {Element} node Element to insert after the reference.
@param {Element/String/Array} referenceNode Reference element, element id or array of elements to insert after.
@return {Element/Array} Element that got added or an array with elements.
Inserts an element after the reference element .