JavaScript Events Worksheet

Questions

Question 1

What is an 'event handler'?

a function that happens when an event happens

Question 2

How are event handlers invoked?

inside the parenthasees of an even listener

Question 3

What is an 'anonymous' function?

a function that is refered to in a handle and can only be used in that one spot

Question 4

Explain what the addEventListener() method of a DOM element is, and explain the purpose of each of it's parameters.

it listens for the event that you ask for and then executes code when the event happens

Coding Problems

Coding Problems - See the 'script' tag below this h3 tag. You will have to write some JavaScript code in it.

Always test your work! Check the console log to make sure there are no errors.

Orange

Green