JSFiddle - React, Tailwind, and code Playground

HTML

<button type="submit" class="register-button">REGISTER</button>

JavaScript

$(".register-button").click(function () {
    var $elem = $(this);

    $.ajax({
        url: '/echo/html',
        type: 'post',
    }).success(function(){
        console.log("done");
        $elem.html("Registered");
        $elem.hide(600);
    });
});