JSFiddle - React, Tailwind, and code Playground

by Neal

HTML

<form id='myForm' action='/echo/html/'>
    <input type='hidden' name='delay' value='1'/>
    <input type='text' name='html' value=''/>
    <input type='submit'/>
</form>

JavaScript

$('#myForm').submit(function(event){

            //url          //post data
    $.post(this.action, $(this).serialize(), function(returnData){
           //do something with returnData
        alert(returnData);
    })

    return false; //do not submit form the normal way

});