en.javascript.info/2-ui/4-forms-controls/1-form-elements/1-add-select-option/task.md
Ilya Kantor 75e30539ef replace
2017-03-19 17:09:37 +03:00

20 lines
357 B
Markdown

importance: 5
---
# Add an option to select
There's a `<select>`:
```html
<select id="genres">
<option value="rock">Rock</option>
<option value="blues" selected>Blues</option>
</select>
```
Use JavaScript to:
1. Show the value and the text of the selected option.
2. Add an option: `<option value="classic">Classic</option>`.
3. Make it selected.