JSFiddle - React, Tailwind, and code Playground
HTML
<div class="add_to_cart_whole"></div>
<input type="button" class="add_to_cart_whole" value="click me"/>
JavaScript
$(document).ready(function () {
$('.add_to_cart_whole').hide();
$(".add_to_cart_whole").click(function () {
var currentId = "hi";
$.ajax({
url: "/echo/add_to_cart_whole/",
type: "GET",
data: "currentId=" + currentId,
dataType: "add_to_cart_whole",
success: function (data, status) {
$('.add_to_cart_whole').text(" The deleted row is " + data.currentId).slideDown();
}
});
});
});