We can attach multiple events to an element with ease using J query as seen in this example.
We've created a script that changes the background color of a paragraph on three events on mouse enter
the background changes to yellow on most leave the background changes to pink and on click it changes
to science.
Now let's take a look at the code to see how this works
in between the open and close script tags.
We can see that we start off with the document ready function.
We then specify the element that we'd like to apply these events to in this case any paragraph tag in
the document.
We then list each event function in action starting with the mouse enter event.
We can see that once with the mouse Entry Event the background color changes to yellow on most leave.
Pink and on click the color changes to.
So you can see that adding multiple events is fairly straightforward with J query.