JavaScript Events Worksheet

Questions

Question 1

What is an 'event handler'?

its a function trigged by set events

Question 2

How are event handlers invoked?

by the browser when it detects that event

Question 3

What is an 'anonymous' function?

a function without a name usally used with event handling

Question 4

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

used to attact a event listener to the dom objects, its first parameter is the event itself that is a string the second parameter is the function itself that runs when the event is triggered

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