JSFiddle - React, Tailwind, and code Playground

by sc0rp10

JavaScript

$('.foo').on('click', function(e) {
    var node = $(this);

    $.ajax({
        "url": node.data("url"),
        "type": "post",
        "success": function() {
            node.closest('.parent').toggleClass('parent_active');
        }
    });
});