JavaScript Events Worksheet

Questions

Question 1

What is an 'event handler'?

It is a block of code used to listen to any specific type of occurance

Question 2

How are event handlers invoked?

They are invoked by a specific event occuring on a targeted HTML element

Question 3

What is an 'anonymous' function?

It is fuction that is defined without a name

Question 4

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

It is used to register an event handler. The purpose of its parameters is to moniter the element for a specific action

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