Chapter 4. Listening and Responding to Events

Listening and responding to events using jQuery is relatively simple in terms of code. Regardless of the code’s simplicity, however, handling events can still be complex. Large numbers of events are generated in seemingly unpredictable order. To be able to respond to events in a useful manner, you need a grasp of which events you can expect, under what circumstances. This chapter provides recipes with which you can log all events of a certain kind and experiment with your input to see what happens. It handles mouse events, keyboard events, form events, and some more general events such as scrolling. After investigating specific events, this chapter demonstrates the advantages of event delegation. ...

Get jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.