innerHTML in javascript

innerHTML in javascript

In javascript we can add or retrieve html contents from web page using innerHTML property.

Syntax
element.innerHTML

Example 1 - set html content

Try Yourself

Example 2 - get html content

Try Yourself