JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" class="ba" checked="checked" />
<input type="text" class="tex" />

JavaScript

$(function () {
    $('.ba').on('change', function () {
        var checked = $(this).prop('checked');
        $('.tex').prop('disabled', !checked);
    });
});