Jquery referencing multiple items on the same line

How can I write this on one line.

$('#id').whatever(); $('#id1').whatever(); $('.class').whatever(); 
+6
jquery elements
source share
1 answer

As with CSS, you can use commas to combine several separate selectors:

 $('#id, #id1, .class').whatever(); 
+10
source share

All Articles