JSFiddle - React, Tailwind, and code Playground
HTML
<td>
<div class="sp-quantity">
<div class="container" style=" font-size:14px; ">
<div class="sp-minus fff"> <a class="ddd" href="#">-</a>
</div>
<div class="sp-input">
<input type="text" class="quantity-input" value="1">
</div>
<div class="sp-plus fff"> <a class="ddd" href="#">+</a>
</div>
</div>
</td>
JavaScript
$(".ddd").on("click", function() {
alert('testing');
var $button = $(this),
$input = $button.closest('.sp-quantity').find("input.quantity-input");
var oldValue = $input.val(),
newVal;
if ($.trim($button.text()) == "+") {
newVal = parseFloat(oldValue) + 1;
} else {
// Don't allow decrementing below zero
if (oldValue > 0) {
newVal = parseFloat(oldValue) - 1;
} else {
newVal = 0;
}
}
$input.val(newVal);
});