JSFiddle - React, Tailwind, and code Playground

by rjurd

HTML

<form id="registration" onSubmit="return CheckForm()">
    <input type="checkbox" id="newsletter"id="myCheck" checked="checked" />Do you like summer?
    <input type="submit" />
</form>

JavaScript

function CheckForm() {
    if ($('#newsletter').prop('checked') === true) {
        alert('Thank You');
        return true;
    }
    else {
        alert('Please answer the question');
        return false;
    }
}