How can I write this on one line.
$('#id').whatever(); $('#id1').whatever(); $('.class').whatever();
As with CSS, you can use commas to combine several separate selectors:
$('#id, #id1, .class').whatever();