up
This commit is contained in:
parent
4bca225593
commit
547854a151
1655 changed files with 847 additions and 89231 deletions
|
@ -1,25 +0,0 @@
|
|||
Решение:
|
||||
|
||||
```html
|
||||
<!--+ run -->
|
||||
<select>
|
||||
<option value="Rock">Рок</option>
|
||||
<option value="Blues" selected>Блюз</option>
|
||||
</select>
|
||||
|
||||
<script>
|
||||
var select = document.body.children[0];
|
||||
|
||||
// 1)
|
||||
var selectedOption = select.options[select.selectedIndex];
|
||||
alert( selectedOption.value );
|
||||
|
||||
// 2)
|
||||
var newOption = new Option("Classic", "Классика");
|
||||
select.appendChild(newOption);
|
||||
|
||||
// 3)
|
||||
newOption.selected = true;
|
||||
</script>
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue