发布于 5年前

js dom 转字符串

function nodeToString ( node ) {  
   var tmpNode = document.createElement( "div" );  
   tmpNode.appendChild( node.cloneNode( true ) );  
   var str = tmpNode.innerHTML;  
   tmpNode = node = null;
   return str;  
}
©2020 edoou.com   京ICP备16001874号-3