JSFiddle - React, Tailwind, and code Playground
HTML
<section class="c-checkboxes-group">
<form action="">
<input class="o-checkbox o-checkbox--main" id="main-checkbox" name="names" type="checkbox" />
<label for="main-checkbox">Family</label>
<input type="submit" value="submit">
</form>
</section>
JavaScript
const form = document.forms[0];
form.addEventListener("submit", function (e) {
const target = e.currentTarget;
debugger;
/* e.preventDefault() */;
});