-1

I have the following where I bind the same event to 3 elements. Is there a way to have the selectors do this in 1 line , like a "OR" in the selector?

$('.fundLoad').keyup(queryRequest);
$('.fundName').keyup(queryRequest);
$('.companyName').keyup(queryRequest);
Amit
  • 45,440
  • 9
  • 78
  • 110
Ian Vink
  • 66,960
  • 104
  • 341
  • 555

1 Answers1

0

Yes, use a comma:

$('.fundLoad, .fundName, .companyName').keyup(queryRequest);

jQuery uses standard CSS selectors as a basis for it's selector specification.

Amit
  • 45,440
  • 9
  • 78
  • 110