JSFiddle - React, Tailwind, and code Playground

by Steven Senkus

HTML

<input type="hidden" name="leadsource" value="Organic - GPI">
    <input type="hidden" name="type" value="request">
    <input type="hidden" name="success" value="http://www.graphicproducts.com/thankyou.php">
    <input type="hidden" name="subject" value="Contact Request">
    <input type="hidden" name="from_http_host" value="www.graphicproducts.com/label-printers/duralabel-pro-series/index.php">
    <input type="hidden" name="form_from_http_host" value="www.graphicproducts.com/label-printers/duralabel-pro-series/index.php">
	<input type="hidden" id="comments_gp" name="comments_gp" value="">
	<input type="hidden" name="EventType" value="2000000">
    <input type="hidden" name="insite_id" value="a4fc5d90-48c0-11e3-8f67-a57fbbaa4ece">
    <input type="hidden" name="EventSubType" value="18">

JavaScript

$('input').each(function(i) {
    var $t = $(this)
console.log($t.attr('name') + " "  +  $t.attr('value'));

})

var data = $('input').map(function(){
    return {
        name: $(this).attr('name'),
        value: $(this).val()
    };
}).get();
    
    console.log(JSON.stringify(data));