JSFiddle - React, Tailwind, and code Playground

HTML

<form id="testform">
     <input type ="text" name="something" value="12" />
     <input type ="text" name="somethingmore" value="13" />
     <input type ="text" name="somethingelse" value="14" />
</form>
<div id="out"></div>

JavaScript

$('#out').html(JSON.stringify($('#testform').serializeArray()));
$('#testform').append($('<input id="test" type="text" class="cosAttribute" name="test" />'));
console.log(JSON.stringify($('#testform').serializeArray()));