Let's finalise this project by adding in a message to our user, so within the star rate, this is where
we're picking up any of the actions that are happening.
And the particular action that we're listening for is the click.
So we don't want to add it in here within the loop because this is looping through each one of the stars
and this is checking to see the click.
And we can also do that as well on the outside before we enter into the function.
So taking that value of if T is equal to click and remember, the T is equal to E type.
So it's telling us which one of the event listeners has been triggered the event.
So checking to see if it's been click and if it has that we know we can output a message to the user.
So taking our value and also we want to check to make sure that the star rate value is actually greater
than or the star, the star value is greater than one, so that at least there's some type of rating
that's been entered and we can take the output, the output element that we selected and update the
inner HTML with the following message so we could say you redid this and then adding in our star value,
so outputting this to the user stars.
So let's try that out.
So now we rated a two stars, three stars, four stars, five stars, and we can adjust the rating surpassing
in this message.
And if we also want to pass in some data to a server or track this rating, this is where we could do
this as well.
So if it's been a click, then this is where we can record whatever that click was, whatever the value
of the star rating was.
Coming up next, we're going to do a quick run through of the code and also do a quick overview of the
code that we've created in the earlier lessons.
So go ahead and add this last part to the project so that we're outputting a message to the user in
regards to how many stars they've clicked.