JSFiddle - React, Tailwind, and code Playground

by bluey

HTML

<form id="myForm">
    Title:   <input name="title" /><br>
    Content: <input name="content" />
</form>
<button id="postBtn">Post</button><br>

<br>
<div id="paramsSent"\>
<div id="return" \>

JavaScript

$('#postBtn').click(function() {
    var str = $('#myForm').serialize();
    $('#paramsSent').html(str);
    
    $.post('yourPostPath',
          str,
          function(data){
              $('#return').html(data);
          });
 });