JSFiddle - React, Tailwind, and code Playground
HTML
<select name="county" id="county">
<option>All Countys</option>
<option>Middlesex</option>
<option>Berkshire</option>
<option>Bedfordshire</option>
</select>
<select name="town" id="town">
<option>All Towns</option>
<option class="Middlesex">Ruislip</option>
<option class="Middlesex">Hillindon</option>
<option class="Uxbridge">Uxbridge</option>
</select>
JavaScript
$(document).ready(function() {
// get a copy of all the towns
var $town = $("#town"),
$towns = $("#town > option").clone();
$("#county").change(function() {
var selCounty = $(this).val();
$town.children().remove();
if (selCounty=="All Countys")
$town.append($towns);
else
$town.append($towns.filter("." + selCounty));
});
});