Welcome back in this lesson, I'm going to show you how we're going to initiate the start of the game,
as well as how we can set up a message area to send messages to the player.
So right now, we don't have anything happening for the player.
The player just sees a start button.
They're not really sure what to do with it.
They can click the start on it and it will disappear.
So what we want to do is add some inter text into message.
Now, of course, we can go into the HTML and we can type some text, refresh it and have the text show
up there.
But we want to do as much as possible within JavaScript.
So let's remove that and go into our JavaScript.
And once we've selected the message area, I also want to set up a function in order to handle some
of this.
We can take a message and we can update the inner HTML of message because we've got it within the message
object just as we were using the button.
And we can type in whatever content we want in there.
And let me just update this before we try.
It should say message.
So let me refresh and we can see that Hello World now gets output into the HTML.
And when you go into the HTML, you can see that the div with the class message now has the words hello
world inside of it, and likely we are going to be doing this quite often.
So usually if I'm repeating something within JavaScript, I'll create a function for it.
So I'm going to create a function called messenger and it's going to pass in an argument of a message.
And then within this argument, this is where we're going to just return back and do that content.
So instead of typing in Hello World, it will take in whatever value is passed in the argument, which
is going to make it a little bit easier for me to continuously call to it.
So separating out that function for it.
And I'm also going to need it down here as well.
So here we can start by click.
And because we did it, as in our HTML, we can set HTML as well into the messenger function within
the argument.
Add some values here and it'll say click the circles as quickly as you see them.
So that's the objective of the game.
So let's try that out.
So say we see it says click start button.
We click the start button.
Now click the circles as quickly as you see them.
We don't see any circles.
We don't see anything happening.
And that's what we've got to work on in the upcoming lessons.
So for now, let's create a function.
And this function is basically going to launch the game.
So whatever gameplay in whatever game or actions we're going to have in here, this is all going to
be launched within that show box.
And essentially we're going to be showing boxes or circles and this will begin the game play.
And that's coming up in the next session.
I'll show you how to do that.
So for now in this.
Lesson we've covered off how to set up a function to update the inner HTML.
So go ahead and add that into your project.
And coming up next, we'll show you how to launch the gameplay.