JSFiddle - React, Tailwind, and code Playground
HTML
<div class="inline actionset">
<div>1</div>
<button>change</button>
</div>
<div class="inline actionset">
<div>2</div>
<button>change</button>
</div>
CSS
.inline {
display:inline-block;
}
.highlight {
background: red !important;
}
.actionset > div {
background: black;
width: 100px;
height: 50px;
color: white;
}
JavaScript
$('.actionset button').on('click', function (e) {
var $this = $(this);
var el = $this.prev();
el.toggleClass('highlight');
});