JSFiddle - React, Tailwind, and code Playground

HTML

<script>
function doAlert() {
    //alert("#");
    var fail_this_check = true;
    if(fail_this_check)
        return false;
    else
        return true;
}
</script>
with return <input type="checkbox" onclick="return doAlert()" /><br/>
without return <input type="checkbox" onclick="doAlert()" />