JSFiddle - React, Tailwind, and code Playground
HTML
<form method="post">
<button class="btn-small">pew</button>
<input type="hidden" name="id_add" value="1">
</form>
<form method="post">
<button class="btn-small">pew</button>
<input type="hidden" name="id_add" value="2">
</form>
<form method="post">
<button class="btn-small">pew</button>
<input type="hidden" name="id_add" value="3">
</form>
<pre id="out"></pre>
CSS
form {
border: solid 1px gray;
margin: 1em;
}
.active {
outline: dashed 2px orange;
}
JavaScript
$('form').submit(function(evt) {
evt.preventDefault();
$(this).toggleClass('active');
out.textContent += this.id_add.value;
});