JSFiddle - React, Tailwind, and code Playground

HTML

<input id="firstName" type="text" class="formfield track" /><br />
<input id="lastName" type="text" class="formfield track" value="something" /><br />
<input id="otherInfo" type="text" class="formfield" /><br />

JavaScript

var tracker = new Object;

$('input.formfield').each(function() {
    tracker[$(this).attr('id')] = false;
});

$(".track").on("change", function() {
    tracker[$(this).attr('id')] = true;
    console.log(tracker);
});