3 /* Parse an HTML string into a DOM Element */
4 module.exports = function(html) {
5 var d = document.createElement('DIV');
6 d.innerHTML = html.trim();
7 var children = d.children;
8 var len = children.length;
9 if (len === 1) return children[0];
11 var docfrag = document.createDocumentFragment();
12 for (var i = 0; i < len; i++) {
13 docfrag.appendChild(children[0]);