JSFiddle - React, Tailwind, and code Playground

HTML

<input id="mycheck" type="checkbox" />

<input id="mybutton" type="button" value="click me" />

JavaScript

$('#mybutton').click(function(e) {
    if ($("#mycheck").is(":checked")) {
        alert("it's checked");
    } else {
        alert("it's not checked");
        return false;
    }
});