Exercise 5
Functions and Event Handling
-
Write a function that takes two numbers as parameters, performs a
mathematical equation, and outputs them on the page.
-
Create an event listener that changes something on the page when an event
has occurred. The event you listen for is up to you. It could be user input
(keystroke, mouse click, scrolling/window resizing) or the passage of time.
Have a look at
MDN Introduction to Events
for a primer (though your exercises should be original and not be copies of the
examples).