1
00:00:00,450 --> 00:00:04,470
Jake Query is designed to respond to events in an HMO document.

2
00:00:05,450 --> 00:00:11,410
All the actions that a visitor performs on your Web page are referred to as events.

3
00:00:11,470 --> 00:00:18,070
There are many different types of events such as clicking with your mouse on an element moving a mouse

4
00:00:18,160 --> 00:00:27,160
over an element even just loading an HMO page in your browser can be considered an event we can program

5
00:00:27,190 --> 00:00:30,100
events to trigger certain actions.

6
00:00:30,100 --> 00:00:35,150
Let's take a look at a basic example on this HMO page.

7
00:00:35,150 --> 00:00:38,240
We've created a script that hides a line of text.

8
00:00:38,360 --> 00:00:39,320
Once it's clicked on

9
00:00:44,180 --> 00:00:50,650
here the event is a mouse click and the action is hiding the text.

10
00:00:50,670 --> 00:00:59,250
Let's take a look at the code for this event.

11
00:00:59,270 --> 00:01:06,790
Now we're focusing on what's in between the open and close script tags.

12
00:01:06,800 --> 00:01:13,540
We start with our document ready function to ensure that the function is only executable once the page

13
00:01:13,540 --> 00:01:16,980
is finished loading.

14
00:01:17,030 --> 00:01:25,270
Next we specify the element that will be affected by the event which in this case is the mouse click.

15
00:01:25,270 --> 00:01:30,460
Lastly we specify that the element should be hidden after the event has taken place

16
00:01:34,640 --> 00:01:38,400
you'll notice that the element disappears on a single mouse click.

17
00:01:38,630 --> 00:01:48,400
We can change from single to double by changing the event to double click.

18
00:01:48,560 --> 00:01:49,630
We save our file.

19
00:01:50,980 --> 00:01:56,030
And refresh the page and notice that single clicking no longer works.

20
00:01:56,170 --> 00:01:59,760
But if we double click it hides the element.
