Now that Alejandra has her website looking polished, she’s realized that she wants the site to be more interactive. She would like to build a shopping cart feature that allows her users to buy travel packages directly from her website.
- popup ads
- animated graphics (2D or 3D)
- interactive audio and video
- maps and other features access the user’s geographic location
- and much more!
- the user clicking on a button
- the user pressing enter on their keyboard
- a video file finishing loading
- the user re-sizing their window
- the user hovering over text on the webpage
onmouseover event is fired.
Hover over the text in the browser to see how it responds to the
Once you have observed the effect of
onmouseover, click the Run button to move on to the next Checkpoint.
What else is happening here?
drawText is a function that is being run on line 2. Change the text that says
'hello world' to
Check out the browser to see what changed! One of the benefits of functions is that they are reusable. The
drawText function allows us to take advantage of the reusability of functions because it can render any input text without us needing to rewrite the logic of the function.
Confused? Don’t worry, we’ll cover functions more thoroughly in the next exercise.