Attributes · selected
Which attributes control the selected option?
selected, value, disabled and the select's multiple attribute decide the default and what is submitted.
| Attribute | What it does | Docs |
|---|---|---|
selected | Boolean. Makes this option the default choice when the select loads. | MDN |
value | The value submitted for the option; without it, the option's text is sent. | MDN |
disabled | Greys out the option so it cannot be chosen or submitted. | MDN |
multiple | On the select, lets several options stay selected and submit as repeated pairs. | MDN |