JavaScript Inner HTML Property Tutorial

innerHTML Property

The innerHTML property sets or returns the HTML content (inner HTML) of an element.

Syntax

Return the innerHTML property:

HTMLElementObject.innerHTML

Set the innerHTML property:

HTMLElementObject.innerHTML = text

Example: 1

Change the HTML content of the element with id=”demo”;

Example: 2

Get the HTML content of the element with id=”myP”

Example: 3

Delete the HTML content of an element.

Take Your Free Live Demo Class Now

Enter Your DETAILS BELOW

To Get Complete Information or We Will Call You

We Will Send You the Course Fees Details In Below Number

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

Enter Your DETAILS BELOW TO take

free demo class