Created
November 14, 2018 15:06
-
-
Save c7x43t/e46338242e1130202053360b616f2eaf to your computer and use it in GitHub Desktop.
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
var html = '<div id="test_div"><ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul></div>'; | |
var parser = new DOMParser(); | |
var wrapper = parser.parseFromString(html, "text/html"); // this is a DocumentFragment | |
// Polyfill for DOMParser.parseFromString to support html: https://developer.mozilla.org/de/docs/Web/API/DOMParser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment