Hi, 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?
+1
A:
I don't see why that is a problem, but in this case you should be able to use the following:
$("#someId, #someOtherId").bind("click", function(e) {...
You can add multiple selectors by separating them with a comma.
T B
2009-10-26 15:48:22