Created
April 27, 2011 18:47
-
-
Save dciccale/944910 to your computer and use it in GitHub Desktop.
JavaScript insertAfter function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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