Learn Create Your Own Split Screen

Next Page

Great!

But let's get the answer displaying inside the div.

You may notice we defined the div with an id.

<div id=MyAnswer>
The id is similar to a variable name — it's a name I just made up, it has to conform to a couple of rules, and it has to be unique.

We can then control what appears inside the div.

function DoMyThing() { MyAnswer.innerHTML = "I got clicked"; }

Try clicking the button.