The innerHTML property represents all the content contained in your element, including other nested elements (like a paragraph might include <em> and <img> elements in addition to the text in the paragraph). In other words, it’s the HTML that’s “INside” your element. Is there an outerHTML property? Yes! And that property gets you all the HTML inside the element, as well as the element itself.
- 6. Interacting with Your Web Page: Getting to know the DOM
- Publisher: O'Reilly Media, Inc.
- Released: March 2014
what are innerHTML and outerHTML?