首页 > 代码库 > js字符串转dom

js字符串转dom

function parse2dom(str){
    var div = document.createElement("div");
    if(typeof str == "string")
        div.innerHTML = str;
    return div.childNodes;
};

 

js字符串转dom