1, function Explanation:
outerhtml Sets or gets the HTML form of the object and its contents
Span style= "font-family:arial, Tahoma, Verdana, Sans-serif;" >
<font size= "3" >
3, the difference:The difference between innerHTML and outerHTML, innertext and Outertext is simply that:1), innerHTML, and outerhtml the HTML that is included when setting the content of the object is parsed, and innertext and outertext do not. 2), when set, innerHTML and innertext only set the text within the label, while outerHTML and Outertext set the text including the label. <ignore_js_op>
Special Note:innerHTML is a standard-compliant attribute, and innertext only works with Internet Explorer, so use innerHTML as much as possible, and less innertext, if you want to output content that does not contain HTML tags, You can use innerHTML to get content that contains HTML tags, and then use regular expressions to remove the HTML tags, and here's a simple example of the standard:<a href= "Javascript:alert (document.getElementById (' Test '). Innerhtml.replace (/<.+?>/gim, '))" > No HTML, meet the standards </a>Detailed Description: http://java.662p.com/thread-3222-1-1.htmlThe difference between InnerHTML, outerhtml, InnerText and Outertext