I have a drop down where the user selects a language:
<select>
<option>English</option>
<option>Spanish</option>
</select>
- I want the default option that is initially displayed to say “Select
a language” instead of “English” (my first option, displayed by
default). - I don’t want the user to be able to select “Select a language”.
If none of the options in the select have a
selectedattribute, the first option will be the one selected.In order to select a default option that is not the first, add a
selectedattribute to that option:You can read the HTML 4.01 spec regarding defaults in select element.
I suggest reading a good HTML book if you need to learn HTML basics like this – I recommend Head First HTML.