JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box" data-id="1">
<a href="#" class="like">like</a>
<a href="#" class="remove">remove</a>
<!--etc-->
</div>
JavaScript
$(function() {
$(".like, .remove").click(function(e) {
var id = $(this).closest('.box').data('id');
var url = $(this).attr('class') + ".php?id=" + id;
// a click on like will generate a url: like.php?id=1
alert(url);
});
});