JSFiddle - React, Tailwind, and code Playground
HTML
<select class='select1'>
<option selected disabled>Select One</option>
<option>Select this</option>
<option>or this</option>
</select>
<select class='select2'>
<option selected disabled>Select One</option>
</select>
JavaScript
Months = {
january:31,
february:28,
March:31,
april:30,
may:31,
june:30,
july:31,
august:31,
september:30,
october:31,
november:30,
december:31
}
$('.select1').html('');
$.each(Months,function(month,days){
$('.select1').append('<option>'+month+'</option>');
});
$('.select1').change(function() {
selected = $('.select1').val();
$('.select2').html('');
$.each(Months,function(month,days) {
if (month == selected) {
for (i=1;i<=days;i++) {
$('.select2').append('<option>'+i+'</option>');
}
}
});
});