JSFiddle - React, Tailwind, and code Playground

by Simon Hartley

HTML

<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<form name="f1" method="post">
<input type="checkbox" name="others">Others

<select id="that_select">
  <option value="a">A</option>
  <option value="b" selected>B</option>
  <option value="c">C</option>
</select></form>

JavaScript

$(function(){
   $("#that_select").prop('disabled',true).hide();
    
    $("[type='checkbox']").change(function(){
        if($(this).is(":checked")) {
            $("#that_select").prop('disabled',false).show("slide");
        }
        else{
            $("#that_select").prop({'disabled': true, 'selectedIndex': 0}).hide("slide");
        }
    });
   
   
});