Learn Create Your Own Split Screen

Next Page

The fact the property is named innerHTML is a clue that what you put in there can be any HTML at all.

In this example, we use <b> (bold), <i> (italic) and <p> (paragraph) tags.

Note that the tags are inside the Javascript string, because within the <script> tag we are writing Javascript, not HTML.

But it's quite ok for us to generate a string that happens to contain some HTML tags, and insert them into a div.