Jake Query is designed to respond to events in an HMO document.
All the actions that a visitor performs on your Web page are referred to as events.
There are many different types of events such as clicking with your mouse on an element moving a mouse
over an element even just loading an HMO page in your browser can be considered an event we can program
events to trigger certain actions.
Let's take a look at a basic example on this HMO page.
We've created a script that hides a line of text.
Once it's clicked on
here the event is a mouse click and the action is hiding the text.
Let's take a look at the code for this event.
Now we're focusing on what's in between the open and close script tags.
We start with our document ready function to ensure that the function is only executable once the page
is finished loading.
Next we specify the element that will be affected by the event which in this case is the mouse click.
Lastly we specify that the element should be hidden after the event has taken place
you'll notice that the element disappears on a single mouse click.
We can change from single to double by changing the event to double click.
We save our file.
And refresh the page and notice that single clicking no longer works.
But if we double click it hides the element.