Back to Web Programming 1

JavaScript Events Worksheet

Questions

Question 1

What is an 'event handler'?

A function that is used when an event occurs.

Question 2

How are event handlers invoked?

They aren't excactly invoked, because they initiate themselves after we create them.

Question 3

What is an 'anonymous' function?

A function that has no name / can't be named.

Question 4

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

It makes it so when the first parameter occurs, the second parameter aka the function initiates.

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