JSFiddle - React, Tailwind, and code Playground

by Timmy Willison

HTML

<form id="form" action="#">
    <div class="wrapper">
        <input name="foo" value="bar">
    </div>
    <div class="wrapper">
        <input name="foo2" value="bar">
    </div>
    <div class="wrapper">
        <input name="foo3" value="bar">
    </div>
</form>

JavaScript

// Serializes form, then .wrapper
console.log('body *: ', $('body *').serializeArray());

// More specific selectors
console.log('wrapper *: ', $('.wrapper *').serializeArray());
console.log('inputs: ', $(':input').serializeArray());