1
00:00:00,120 --> 00:00:04,360
There are different methods we can use for outputting data using JavaScript.

2
00:00:04,530 --> 00:00:10,350
The first we'll explore is the document dot right method let's take a look at an example to see how

3
00:00:10,350 --> 00:00:13,560
this works in this HMO page.

4
00:00:13,590 --> 00:00:22,280
We have a script that will display the result of a simple calculation using document dot rate.

5
00:00:22,420 --> 00:00:32,890
You can see here we have two values and we want to add them together five plus six.

6
00:00:33,130 --> 00:00:40,420
The result of this equation will be displayed in the content area of our web browser because we have

7
00:00:40,420 --> 00:00:46,610
attached the document dot right function next to it.

8
00:00:46,690 --> 00:00:54,030
So here's the web browser and we can see that the results are displayed beneath this line of text.

9
00:00:55,110 --> 00:01:05,240
So if we were to change the equation and save our file it would update the value.

10
00:01:05,430 --> 00:01:12,700
And so it's that simple that's how the document rate function works.

11
00:01:12,830 --> 00:01:16,620
Another method of outputting data is the window alert.

12
00:01:16,640 --> 00:01:20,930
This method will output the data in a pop up message box.

13
00:01:20,930 --> 00:01:28,480
So let's replace the document dot right with window dot alert and see the difference.

14
00:01:31,460 --> 00:01:36,740
So now we can see that we get a pop up message box with the value 13.
