HTML Attributes
HTML selected attribute
Sets an option's default selected state. The current selected property may change independently after interaction. A single-select should have only one default selected option. Applicable elements include: <option>. Check each element’s value rules. Boolean syntax: presence enables the state; omit the attribute to disable it. A string value of "false" does not turn it off.
Formal Syntax & Structure
html syntaxhtml
selectedParameters & Attributes
| Name | Type | Description |
|---|---|---|
| selected | boolean | Sets an option's default selected state. The current selected property may change independently after interaction. A single-select should have only one default selected option. |
Working Example
Example Snippethtml
<label> Size <select> <option>Small</option> <option selected>Medium</option> </select></label>