This was an updated version of my original Contextual jQuery talk from Boston 2010. The syntax has been updated for jQuery 1.7's `on` method. More examples were added, and some examples were changed to make the meaning more clear.
for each element • Executes only when event is triggered on bound elements • Elements can be retrieved ahead of time • Must be bound after the DOM is ready • Single handler for all elements • Checks event on every element in its context, and executes when a match is found • Elements should be retrieved at run time • Can be setup as soon as the context element is ready
early, strive for just-in-time wherever possible. • Don't be afraid to use complex selectors in the right settings. • Think twice before adding to your markup. See if there is another way ﬁrst. • Always write your code with reusability in mind. Think in conventions as you work.