JSFiddle - React, Tailwind, and code Playground
by gromer
HTML
<input type="button" class="elementsWithClass" value="Button 1" />
<input type="button" class="elementsWithClass" value="Button 2" />
<input type="button" class="elementsWithClass" value="Button 3" />
JavaScript
var foo = function(event) {
console.log('Clicked ' + $(this).val());
};
$('.elementsWithClass').click(foo);
$('.elementsWithClass').click(foo);
$('.elementsWithClass').click(foo);
//$('.elementsWithClass').unbind('click');
$('.elementsWithClass').click(foo);