Created
August 6, 2013 16:34
-
-
Save mateuszkocz/6166163 to your computer and use it in GitHub Desktop.
insertAdjacentHTML(). Performant way of inserting HTML into a DOM. Source: http://ejohn.org/blog/dom-insertadjacenthtml/
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
var ul = document.getElementById("list"); | |
ul.insertAdjacentHTML("beforeEnd", "<li>A new li on the list.</li>"); | |
ul.insertAdjacentHTML("beforeEnd", "<li>Another li!</li>"); | |
.insertAdjacentHTML("beforeBegin", ...) | |
.insertAdjacentHTML("afterBegin", ...) | |
.insertAdjacentHTML("beforeEnd", ...) | |
.insertAdjacentHTML("afterEnd", ...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment