I have a select tag and I want to check if a moth is selected.
<select name=Birth_Month>
<option value= SELECTED>- Month -</option>
<option value=January>January</option>
<option value=Fabruary>Fabruary</option>
<option value=March>March</option>
<option value=April>April</option>
<option value=May>May</option>
<option value=June>June</option>
<option value=July>July</option>
<option value=August>August</option>
<option value=September>September</option>
<option value=October>October</option>
<option value=November>November</option>
<option value=December>December</option>
</select>
So do this:
if (document.registration_form.Birth_Month.value === '')
{
alert('Please fill select Month!');
}
But this JavaScript for some select-s work and for some of them, does not. Obviously, when the - Month - is selected the it returnes - Month - insted of (empty string). What I have done wrong? What is the best way of checking the tag's selection?