innerHTML property

The innerHTML property is used to get or replace the content of an HTML element.

grammar:

Object.innerHTML

Notice:

1.Object is the obtained element object, such as the element obtained by document.getElementById("ID").

2. Pay attention to writing, innerHTML is case-sensitive.

We get the <p> element through id="con", and output and change the content of the element. The code is as follows:

result:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326521928&siteId=291194637