Created
January 7, 2016 08:09
-
-
Save tantita/e7d3130c22de2310e8c2 to your computer and use it in GitHub Desktop.
attach event to multiple elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(a & b).click(function () { /* */ }); // <= works (event is attached to both) | |
| var a = $("#a"); | |
| var b = $("#b"); | |
| var combined = a.add(b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment