JSFiddle - React, Tailwind, and code Playground

HTML

<form id="test">
    <input type="text" id="inp1" name="inp1" />
    <input type="button" name="commit" value="submit"/>
</form>

JavaScript

$(function(){
    $('input[type="button"]').click(function(){
        $.ajax('/echo/json/', {success: function() {
            alert('I am local event');
        }});
    });
    
    $(document).bind('ajaxSuccess', function() {
        alert('I am global event');
    });
});