1
00:00:00,420 --> 00:00:06,350
We can attach multiple events to an element with ease using J query as seen in this example.

2
00:00:06,360 --> 00:00:13,860
We've created a script that changes the background color of a paragraph on three events on mouse enter

3
00:00:14,190 --> 00:00:22,860
the background changes to yellow on most leave the background changes to pink and on click it changes

4
00:00:22,860 --> 00:00:29,540
to science.

5
00:00:29,550 --> 00:00:32,220
Now let's take a look at the code to see how this works

6
00:00:38,570 --> 00:00:41,870
in between the open and close script tags.

7
00:00:41,990 --> 00:00:48,180
We can see that we start off with the document ready function.

8
00:00:48,330 --> 00:00:55,020
We then specify the element that we'd like to apply these events to in this case any paragraph tag in

9
00:00:55,020 --> 00:01:00,260
the document.

10
00:01:00,460 --> 00:01:06,340
We then list each event function in action starting with the mouse enter event.

11
00:01:06,850 --> 00:01:16,680
We can see that once with the mouse Entry Event the background color changes to yellow on most leave.

12
00:01:16,690 --> 00:01:21,370
Pink and on click the color changes to.

13
00:01:23,530 --> 00:01:28,840
So you can see that adding multiple events is fairly straightforward with J query.
