Created
April 29, 2012 12:18
-
-
Save suhajdab/2550036 to your computer and use it in GitHub Desktop.
prependChild
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
Node.prototype.prependChild = function(el) { | |
this.childNodes[1]&&this.insertBefore(el, this.childNodes[1]) || this.appendChild(el); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much for this