Home > Web Front-end > JS Tutorial > Analysis of the difference between InnerHtml and InnerText_Basic knowledge

Analysis of the difference between InnerHtml and InnerText_Basic knowledge

WBOY
Release: 2016-05-16 18:55:31
Original
994 people have browsed it

The most detailed answer can be found on MSDN

InnerText
http://msdn.microsoft.com/zh-cn/library/system.web.ui.htmlcontrols.htmlcontainercontrol.innertext.aspx

InnerHtm
lhttp://msdn.microsoft.com/zh-cn/library/system.web.ui.htmlcontrols.htmlcontainercontrol.innerhtml.aspx

Brief explanation:

InnerText can be used to output the content you assigned to this attribute as is.
When the InnerHtml output content encounters special tags, such as , it will be interpreted by the browser as an html language tag, and will not be output.

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