JSFiddle - React, Tailwind, and code Playground
HTML
<select id="products" name='typeproduct'>
<option> </option>
<option id="clothes">Анцуг</option>
<option id="shoes">Спортна обувка</option>
</select>
<select id="size" name='size'>
<option> </option>
<option class="shoes">42 - за обувка</option>
<option class="shoes">43 - за обувка</option>
<option class="shoes">44 - за обувка</option>
<option class="clothes">L - за дреха</option>
<option class="clothes">M - за дреха</option>
<option class="clothes">XL - за дреха</option>
<option class="clothes">S - за дреха</option>
</select>
CSS
.clothes {
display: none;
}
.shoes {
display: none;
}
JavaScript
$(document).ready(function() {
$("#products").change(function() {
var type = $("#products option:selected").attr("id");
if (type == 'shoes')
{
$( "." + type ).css('display', 'inline');
$( ".clothes" ).css('display', 'none');
}
else if( type == 'clothes')
{
$( "." + type ).css('display', 'inline');
$( ".shoes" ).css('display', 'none');
}
else
{
$( ".clothes" ).css('display', 'none');
$( ".shoes" ).css('display', 'none');
}
});
});