Home > Web Front-end > JS Tutorial > body text

Usage and difference analysis of innerHTML, outerHTML, innerText, outerText_javascript skills

WBOY
Release: 2016-05-16 17:09:07
Original
1131 people have browsed it

This is a layer< /div>








innerHTML gets the HTML within the tag

outerHTML gets the tag and the HTML within the tag

innerTEXT and outerTEXT is the same as getting the text within the label.




This is a layer










The HTML in the innerHTML setting tag

outerHTML setting tag and the HTML in the tag

innerTEXT sets the text in the tag

innerTEXT sets the text in the tag, including the label, and replaces it.

innerHTML sets or gets the HTML located within the start and end tags of the object

outerHTML sets or gets the HTML form of the object and its content

innerText sets or gets the start of the object and the text within the closing tag

outerText sets (including tags) or gets (excluding tags) the text of the object


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