Summary
The abilities we’ve discussed in this chapter allow us to:
React to a user’s click on a page element with
.bind()
or.click()
and change the styles used on the pageUse event context to perform different actions depending on the page element clicked, even when the handler is bound to several elements
Alternately expand and collapse a page element by using
.toggle()
Highlight page elements under the mouse cursor by using
.hover()
Influence which elements get to respond to an event with
.stopPropagation()
and.preventDefault()
Call
.unbind()
to remove an event handler we’re done withCause bound event handlers to execute with
.trigger()
.
Taken together, we can use these capabilities to build quite interactive pages. In the next chapter, we’ll learn how to provide visual feedback to the user during these interactions.