The innerHTML Property

Contact Us or call 1-877-932-8228
The innerHTML Property

The innerHTML Property

Most HTML elements have an innerHTML property, which can be used to access and modify the HTML within that element. The innerHTML property wasn't included in any specification until HTML5. However, as it's extremely useful and well supported, we will use it widely throughout this course.

innerHTML Illustration

Given the code:

<p>I <strong>love</strong> Webucator.</p>

the innerHTML property of the <p> tag would be: "I <strong>love</strong> Webucator."

Tip: you can use the innerHTML property to either get the element's innerHTML value (as shown above) or you can use it to set the element's innerHTML value. More on this later in the lesson.