// store selector-results in variables and reuse
$sel = $('.foo-class')

$sel.click
$sel.find('.bar')
$sel.somePlugin
....


// specify selectors as hard as possible
$('body > div.foo > div.bar > a.foobar')
is more specific and significantly faster than
$('a.foobar')


// use the scope
$('div.foobar').click(function() {
  // using this as scope to start searching for .bar
   $('.bar', this).each( ... )
   or
   $(this).find('.bar').each( ... )
});

Reply via email to