© Jack Franklin, Russ Ferguson 2017

Jack Franklin and Russ Ferguson, Beginning jQuery, https://doi.org/10.1007/978-1-4842-3027-5_6

6. More Events

Jack Franklin and Russ Ferguson2

(1)Aviation House, GDS, 6th Floor Aviation House, London, UK

(2)Apt 129, Ocean, New Jersey, USA

At the end of the last chapter, you ended up with a respectable accordion, which was the first major bit of jQuery you’d embarked on. You might not have realized it, but the code you wrote could be tidied up. In this chapter, you’ll round out your knowledge of events by looking at the more advanced features, including:

  • Event delegation

  • Event propagation

  • Preventing default behavior

  • Creating your own events

Once you’ve covered these features, you’ll take another look at your accordion ...

Get Beginning jQuery: From the Basics of jQuery to Writing your Own Plug-ins now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.