When you refresh your email inbox, double tap on a post, or scroll through a newsfeed — something cool happens in your browser. These actions are known as events!
Events on the web are user interactions and browser manipulations that you can program to trigger functionality. Some other examples of events are:
- A mouse clicking on a button
- Webpage files loading in the browser
- A user swiping right on an image
When a user does any of the above actions, they’re causing the event to be fired or be triggered. As in, “a click event fired when the button was clicked”. Being able to respond to these events makes your website interactive and therefore dynamic.
Check out the recipe webpage — interact with the page and see how it responds. What events do you think are firing?
You’ll learn more about each event as you progress in the lesson, but here’s a quick overview:
- Click the
+button to increase the measurements of the ingredients.
- Hover over the instructions to see the estimated cook time.
- Click on highlighted ingredients in the instructions for facts about the foods in the ingredient list.
- Click the bar at the bottom (footer) to change its background color.