Reputation: 42818
How can i write this in one line.
$('#id').whatever();
$('#id1').whatever();
$('.class').whatever();
Upvotes: 7
Views: 3551
Reputation: 303421
As with CSS, you can use commas to join together multiple distinct selectors:
$('#id, #id1, .class').whatever();
Upvotes: 11