If I have following in jQuery $(“#someId”).add(“#someOtherId”).bind(“click”, function(e) {…
I get the click bound only to the last element. How can I use add() and bind all elements to some event?
If I have following in jQuery $(#someId).add(#someOtherId).bind(click, function(e) {… I get the click bound
Share
Easiest solution?
Multiple selectors can be separated by commas.
Alternate solution? Use
andSelf():