1
00:00:00,120 --> 00:00:06,420
Let's finalise this project by adding in a message to our user, so within the star rate, this is where

2
00:00:06,420 --> 00:00:08,880
we're picking up any of the actions that are happening.

3
00:00:09,060 --> 00:00:11,810
And the particular action that we're listening for is the click.

4
00:00:12,000 --> 00:00:17,640
So we don't want to add it in here within the loop because this is looping through each one of the stars

5
00:00:17,950 --> 00:00:20,940
and this is checking to see the click.

6
00:00:21,090 --> 00:00:25,530
And we can also do that as well on the outside before we enter into the function.

7
00:00:25,860 --> 00:00:31,220
So taking that value of if T is equal to click and remember, the T is equal to E type.

8
00:00:31,470 --> 00:00:36,340
So it's telling us which one of the event listeners has been triggered the event.

9
00:00:36,750 --> 00:00:43,520
So checking to see if it's been click and if it has that we know we can output a message to the user.

10
00:00:43,920 --> 00:00:51,720
So taking our value and also we want to check to make sure that the star rate value is actually greater

11
00:00:51,720 --> 00:00:57,600
than or the star, the star value is greater than one, so that at least there's some type of rating

12
00:00:57,600 --> 00:01:05,160
that's been entered and we can take the output, the output element that we selected and update the

13
00:01:05,160 --> 00:01:14,040
inner HTML with the following message so we could say you redid this and then adding in our star value,

14
00:01:14,730 --> 00:01:17,490
so outputting this to the user stars.

15
00:01:17,760 --> 00:01:18,670
So let's try that out.

16
00:01:18,840 --> 00:01:25,230
So now we rated a two stars, three stars, four stars, five stars, and we can adjust the rating surpassing

17
00:01:25,230 --> 00:01:26,070
in this message.

18
00:01:26,280 --> 00:01:34,290
And if we also want to pass in some data to a server or track this rating, this is where we could do

19
00:01:34,290 --> 00:01:34,980
this as well.

20
00:01:35,130 --> 00:01:41,100
So if it's been a click, then this is where we can record whatever that click was, whatever the value

21
00:01:41,100 --> 00:01:42,420
of the star rating was.

22
00:01:42,810 --> 00:01:49,110
Coming up next, we're going to do a quick run through of the code and also do a quick overview of the

23
00:01:49,110 --> 00:01:51,030
code that we've created in the earlier lessons.

24
00:01:51,300 --> 00:01:56,910
So go ahead and add this last part to the project so that we're outputting a message to the user in

25
00:01:56,910 --> 00:01:58,350
regards to how many stars they've clicked.
