JSFiddle - React, Tailwind, and code Playground

HTML

// I have these two dropdowns and wish to know how to create it so that the first dropdown is only visible then the user selects a category ie Inertiors then all the sub categories of interiors then show in another dropdown

<div class="control-group" id="cat">
    	<label class="control-label" for="name">Category&nbsp;<span style="color: red;">*</span></label>
    	
    	<div class="controls">
    		<?php  echo form_dropdown('category', $categories, 'id="cat"'); ?>

    	</div>
    	</div>
        <div class="style-sub-1" id="subcategory">
            <div class="control-group style-sub-1">
            <label class="control-label" for="name">Sub Category&nbsp;<span style="color: red;">*</span></label>
            
            <div class="controls">
                <?php echo form_dropdown('subcategory', $subcategories, 'id="subcategory"'); ?>
            </div>
            </div>
        </div>