JSFiddle - React, Tailwind, and code Playground
HTML
<button id="button">Button</button>
<div id="result"></div>
JavaScript
$(function() {
$('#button').click(function() {
$.ajax({
type: 'POST',
url: '/echo/json',
data: {
delay: 5,
json: JSON.stringify({
'hello': 'world'
})
},
dataType: 'json',
success: function(data) {
alert(data);
}
});
});
});