addEventListener

  • You can "listen" for events in JavaScript like you can in HTML
  • Similar to adding an onclick event handler in HTML

2 / 21