Home > Web Front-end > JS Tutorial > 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
Release: 2016-05-16 17:58:32
Original
1059 people have browsed it

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>





Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template