JSFiddle - React, Tailwind, and code Playground
HTML
<p id="output"></p>
<form>
<input name="a" value="a">
<input name="b" value="b">
<input name="c" value="c">
<input name="d" value="d">
<input name="e" value="e">
<input type="button" value="Click"
</form>
JavaScript
$('input[type="button"]').on("click", function(){
var json = $( 'form' ).serializeArray()
var str = JSON.stringify(json)
$('#output').html( str );
})