JSFiddle - React, Tailwind, and code Playground

by brigand

HTML

<form action="" id="example">
  <input type="checkbox" name="first" id="" checked>
  <input type="checkbox" name="second" id="" checked>
  <input type="checkbox" name="third" id="" >
</form>

<pre id="out"></pre>

JavaScript

for (const item of new FormData(example)) {
	out.textContent += JSON.stringify(item) + '\n';
}