Skip to content

Instantly share code, notes, and snippets.

@tantita
Created January 7, 2016 08:09
Show Gist options
  • Select an option

  • Save tantita/e7d3130c22de2310e8c2 to your computer and use it in GitHub Desktop.

Select an option

Save tantita/e7d3130c22de2310e8c2 to your computer and use it in GitHub Desktop.
attach event to multiple elements
$(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