JSFiddle - React, Tailwind, and code Playground

http://stackoverflow.com/questions/16682172/is-there-a-way-to-isolate-a-button-from-other-buttons-on-the-page-with-the-same/16682326?noredirect=1#comment24009671_16682326

by jasenhk

HTML

<button name="foo">A</button>
<button name="foo">B</button>

JavaScript

$("button[name='foo']").on("click", function() {
    alert($(this).text());
});