JSFiddle - React, Tailwind, and code Playground

by lshettyl

HTML

<form id="form1">
    <input type="submit" />
</form>

<div id="box"></div>

JavaScript

$("#form1").submit(postData);
var count = 1;
function postData() {
    $("input:submit").val("Ajax in progess...").prop("disabled", true);
    $.ajax({
        type: 'GET',
        url: '/echo/html/',
        success: function (data) {
            $("#box").html(data + (count++) + " times");
            setTimeout(postData, 1000);
        }
    });
    return false;
}