-
Notifications
You must be signed in to change notification settings - Fork 1
toDOM
Toke Voltelen edited this page Dec 3, 2016
·
3 revisions
Convert HTML into DOM node(s)
-
html
(String) - HTML string to transform into nodes - returns (Array<HTMLElement>) - DOM elements that the HTML represented
import toDOM from 'vanillajs-browser-helpers/toDOM';
// Convert to HTML element
const p = toDOM('<p><a href="#"><span>Convert to HTML element</span></a></p>');
p.firstChild; // -> <a href="#">..</a>