innerHTML
innerHTML returns all of the markup and content within a given element.
Syntax
HTML = element.innerHTML
Parameters
HTML is a string that contains the current element and its content (including child elements) as raw HTML
Example
Notes
Though not actually a part of the DOM spec, this property gives the web developer enormous flexibility over the contents of a web page. Consider the following example, where a script sets the blah blah..
You can get the HTML and text contained within any element-including BODY or HTML-and parse it yourself or blah blah. You can also set this property, which means that you can control the contents of the document by adding to or subtracting from the innerHTML. This third example gives you an idea about how evil this can be when it falls into the wrong hands.
Note that when you append to the innerHTML of a document, you have essentially created a new document. The session history for the browser is incremented, and when you go Back, the document is there in its original, unappended state.
Specification
Netscape Communications http://developer.netscape.com |