Skip to content

Instantly share code, notes, and snippets.

@dciccale
Created April 27, 2011 18:47
Show Gist options
  • Save dciccale/944910 to your computer and use it in GitHub Desktop.
Save dciccale/944910 to your computer and use it in GitHub Desktop.
JavaScript insertAfter function
// JavaScript function to insert a node after another node
function insertAfter(node, nodeToInsert) {
node.parentNode.insertBefore(nodeToInsert, node.nextSibling);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment