JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="search" />
<input type="checkbox" id="cb" /><label for="cb">Enabled only if no search term</label>

JavaScript

$('#search').change(function() {

    if( $(this).val() === '' ){
        $('#cb').attr('disabled', 'disabled');
    } else {
        $('#cb').removeAttr('disabled');
    }
    
});