Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Last active June 22, 2017 22:17
Show Gist options
  • Select an option

  • Save rogerwschmidt/8ff728fd8043fc6a581ed9d99dadfa5f to your computer and use it in GitHub Desktop.

Select an option

Save rogerwschmidt/8ff728fd8043fc6a581ed9d99dadfa5f to your computer and use it in GitHub Desktop.

JQuery Events Intructor Events

Objectives

  • Explain what the jQuery Event API is.
  • Explain why the jQuery Event API is important.
  • Use the jQuery Event API to respond to user interaction.
  • Use the jQuery Event API to delegate events.

Explain what the jQuery Event API is.

Turn to your neighbor and explain what the JQuery Event API is. Also, write down on your table the code to add a click event listener to the li elements below, then print the content of the clicked li.

<ul>
  <li>Milk</li>
  <li>Cheese</li>
  <li>Banana</li>
  <li>Eggs</li>
</ul>

Explain why the jQuery Event API is important.

Turn to your neighbor and explain to each other why the JQuery Event API is important. Be prepared to share your answer with the class.

Use the jQuery Event API to respond to user interaction.

  • With your neighbor create a example that adds a mouseenter event to an element, and then removes the event.
  • How do you remove all events on an HTMLelement?
  • With your neighbor create an JQuery event handler to capture if the Shift keys has been pressed.
  • What event is triggered when you submit a form?

Use the jQuery Event API to delegate events.

  • Turn to your neighbor and explain what is event delegation is. Be prepared to share your discussion.
  • With your neighbor, refactor the example above using event delegation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment