![]() |
VOOZH | about |
The innerHTML property sets or returns the HTML content (inner HTML) of an element. It allows you to manipulate the inner content, including HTML tags, by assigning new HTML strings or retrieving existing content, making it useful for dynamic updates on web pages.
It returns the innerHTML Property.
Object.innerHTMLIt is used to set the innerHTML property.
Object.innerHTML = valueWhere,
Return Value: This property returns a string that represents the HTML content of an element.
Example 1: This example shows how to change the content of the paragraph tag using the innerHTML property.
Output:
Example 2: This example shows how to get the value of the paragraph tag using the innerHTML property.
Output:
Supported Browsers: The browser supported by DOM innerHTML property are listed below: