JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<button id="add_comment">Demo
</button>
</form>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
JavaScript
$('#add_comment').click(function(){
var demo = "hello";
$.ajax({
type: 'POST',
data: {'demo': demo},
success: function (data) {
console.log(data);
},
});
});