JSFiddle - React, Tailwind, and code Playground

by thecodeparadox

HTML

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

<select id="oo" disabled="true">
    <option>a</option>
    <option>b</option>
    <option>c</option>
</select>

JavaScript

$('#dw').on('change', function() {

    // If this.checked = true, then select will enabled else disabled
    // instead of attr() use prop()
    $('#oo').prop('disabled', !this.checked);
});