WEBVTT

0
00:00.440 --> 00:00.890
Hey.

1
00:00.890 --> 00:02.300
Hey, my dear comrades.

2
00:02.300 --> 00:02.930
Welcome back.

3
00:02.930 --> 00:03.560
Welcome back.

4
00:03.560 --> 00:05.450
Hope you are amped [excited]! Hope you're having a lot of fun.

5
00:05.450 --> 00:08.120
What is this example or challenge all about?

6
00:08.900 --> 00:10.220
Very, very simple.

7
00:10.220 --> 00:15.830
I want us to display a very simple multiplication to the screen, to the user.

8
00:15.860 --> 00:20.270
Can you see I've got a default value of zero currently on the browser?

9
00:20.540 --> 00:23.390
Well, that is wrapped in an output element.

10
00:23.420 --> 00:25.040
We're dealing with the output element.

11
00:25.040 --> 00:29.450
So I want you to use an output element to try and figure out the solution to this.

12
00:30.170 --> 00:37.880
And all I want to happen is obviously the user types, a number, let's say five multiplied by what,

13
00:37.880 --> 00:43.790
let's say another five, and I want the result displayed in that output element to a user. In order to

14
00:43.790 --> 00:48.410
display this result, I want to listen for the oninput event.

15
00:48.440 --> 00:53.960
The other nuance with the solution I'm going to do is I'm going to write the JavaScript all inline.

16
00:53.960 --> 00:57.110
So I'm going to be using an inline event listener.

17
00:57.110 --> 00:59.270
I know it's not the best way to do things.

18
00:59.270 --> 01:06.200
I'd rather have an external JavaScript file and add an event listener to an element and do it that way.

19
01:06.200 --> 01:07.640
But I want to keep it very simple.

20
01:07.640 --> 01:09.170
I want to keep a file very small.

21
01:09.170 --> 01:10.550
It's very easy example.

22
01:10.550 --> 01:17.090
So I'm going to be using an inline event listener. In order to identify the certain inputs in that event

23
01:17.090 --> 01:21.740
listener method, you have to give each of these inputs a name attribute.

24
01:21.740 --> 01:26.510
In fact, you also have to give the output element a name attribute so you can identify it when you are

25
01:26.510 --> 01:27.740
executing your code.

26
01:27.920 --> 01:31.640
If you don't know what I mean, don't stress, just set up the HTML.

27
01:31.670 --> 01:36.380
Try and get that at least done by yourself. If you do know what I'm talking about, give it a go.

28
01:36.380 --> 01:40.070
And in the solution video, I'll take you through everything.

29
01:40.310 --> 01:41.090
I can't wait.

30
01:41.140 --> 01:41.600
See you now.