addEventListener

  • We just used a function in a new way there...
  • Why not myButton.addEventListener("click", handleClick());?
  • Usually we want to call a function
  • In this case, we want to say what to do when a button is clicked

3 / 21