Created
September 28, 2013 11:53
-
-
Save xyqfer/6741327 to your computer and use it in GitHub Desktop.
insertAfter
This file contains hidden or 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
function insertAfter(newChild,refChild){ | |
varparElem=refChild.parentNode; | |
if(parElem.lastChild==refChild){ | |
refChild.appendChild(newChild); | |
}else{ | |
parElem.insertBefore(newChild,refChild.nextSibling); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment