There must be an HTML element like paragraph, span, div etc.
An HTML element must have an Id.
We access the HTML element by using the id (to access an HTML element using Id, we use an HTML DOM method getElementbyId()).
Then, we write the text to the HTML element by using an HTML DOM property innerHTML.
In this example, we have two paragraphs with p1 and p2 ids, we are writing two different texts in these HTML elements (paragraphs).