parseHTML,仿jq生成dom对象.txt // 仿jq生成dom对象var parseHTML = function(str) { var tmp = document.implementation.createHTMLDocument(); tmp.body.innerHTML = str; return tmp.body.children;};parseHTML(htmlString);
// 仿jq生成dom对象 var parseHTML = function(str) { var tmp = document.implementation.createHTMLDocument(); tmp.body.innerHTML = str; return tmp.body.children; }; parseHTML(htmlString);