If my markup looks like this:
<button id="button-1" class="nice">
<button id="button-2" class="nice">
<button id="button-3" class="nice">
and I define the following jQuery:
$(".nice").click(function () {
// something happens
});
How many event listeners are established? 1 or 3?
If I have 1000 buttons instead of 3, should I use event delegation instead?
Is it best, performance-wise, to not define jQuery calls on classes of elements if those classes contain a large number of elements in the markup?