-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
  • 43,881
  • 8
  • 73
  • 106
Ian Vink
  • 63,888
  • 100
  • 326
  • 544

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
  • 43,881
  • 8
  • 73
  • 106