The value of the option
in the select
list doesn’t affect the validity of the select
element.
One thing that you need to keep in mind is that the id
of an element must be unique for consistency in accessing that element properly. If duplicate id
s exist for multiple elements the last instance of that id
will be selected. You definitely need not worry about the duplication of values of the option
s in the select
list.
This may even be required too, e.g. the following:
<select>
<option value="fruit">mango</option>
<option value="flower">rose</option>
<option value="fruit">pineapple</option>
<option value="flower">lotus</option>
<option value="flower">lily</option>
</select>
Now if the user selects any of rose
, lotus
, or lily
, the value of the select element will be flower
, and in case either of mango
and pineapple
is selected, the value of the select
element will be fruit
. So it’s perfectly OK, and you may need this sometimes.