1. document.body.textContent//firefox浏览器  
  2.   
  3.   
  4. document.body.innerText//适用ie webkit浏览器   
  5.   
  6. document.body.innerHTML.replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi,'').replace(/<[^>]+?>/g,'').replace(/\s+/g,' ').replace(/ /g,' ').replace(/>/g,' ');  

转自:http://blog.csdn.net/zhhaogen/article/details/7370052

相关文章:

  • 2022-12-23
  • 2021-04-05
  • 2021-08-21
  • 2022-01-05
  • 2021-06-27
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
相关资源
相似解决方案