Home  >  Article  >  Web Front-end  >  JS obtains the implementation code of the entire page document_javascript skills

JS obtains the implementation code of the entire page document_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:58:321039browse

The only thing that needs attention:
innerText and textContent, innerHTML cannot be used when displaying the page, otherwise it will be parsed. innerText and textContent are the differences between browsers other than FF and FF.

Copy code The code is as follows:

var innerText = document.body.innerText ? 'innerText' : 'textContent';

The above statement is processed at the beginning to avoid multiple judgments
Demo texture:


demo:
Copy code The code is as follows:









 
Rest rest
< /pre>





Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn