JSFiddle - React, Tailwind, and code Playground
HTML
<form id="form-invite">
<input type="checkbox" name="rules" value="Yes" /> <span id="rulesInfo">I read the Privacy Policy</span><br/>
<input type="submit" value="submit"/>
</form>
JavaScript
document.getElementById("form-invite").onsubmit = function() {
alert(this.rules.checked);
return this.rules.checked;
}