Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Last active February 27, 2018 18:21
Show Gist options
  • Save rogerwschmidt/9ee0807cf1a2c679ec82bd7d0fad70c3 to your computer and use it in GitHub Desktop.
Save rogerwschmidt/9ee0807cf1a2c679ec82bd7d0fad70c3 to your computer and use it in GitHub Desktop.

DOM Events Instructor Notes

Objectives

  • Create a render function
  • Attach an event handler to a DOM element
  • Use a form to collect information
  • Handle bubbling events
  • Explain what events are
  • Describe why events are useful

How do you create a render function?

How do you attach an event handler to a DOM element?

  • Attach an event handler to the button, and have it add an item to the list

How do you use a form to collect information?

  • Wrap the input tag and and button in a form
  • As a table describe why using a form is useful
  • What do you use to prevent the form from submitting?

How do you handle bubbling events?

  • Add an id attribute to each list item
  • Add a delete button to each list item
  • Add an event handler on the ul to handle deletion

What are event handlers?

  • With your table, define event handlers

Why are event handlers useful?

  • With your table, explain why event handlers are useful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment