JSFiddle - React, Tailwind, and code Playground

by Bryan Barrera

HTML

<input type="checkbox" id="myCheck" checked>Add new item type
<div class="row hide" id="area">Something</div>

JavaScript

$('#area').hide();

function checkval() {

    if ($('#myCheck').is(':checked')) {
        alert('is checked');
        $('#area').show();
    } else {
        $('#area').hide();
    }

}

$(function () {
    checkval(); // this is launched on load
    $('#myCheck').click(function () {
        checkval(); // this is launched on checkbox click
    });

});