JSFiddle - React, Tailwind, and code Playground
by j08691
HTML
<form>
<select id="mySelect" onChange="check(this);">
<option>No</option>
<option>Yes</option>
</select>
<select id="mySelect1" disabled="disabled" >
<option>Dep1</option>
<option>Dep2</option>
<option>Dep3</option>
<option>Dep4</option>
</select>
</form>
JavaScript
function check(elem) {
document.getElementById('mySelect1').disabled = !elem.selectedIndex;
}