Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Form properties and methods#308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
MykolaSopiha merged 8 commits intojavascript-tutorial:masterfromjeneg:2-4-1
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
The solution, step by step:
Рішення, крок за кроком:

```html run
<select id="genres">
<option value="rock">Rock</option>
<option value="blues" selected>Blues</option>
<option value="rock">Рок</option>
<option value="blues" selected>Блюз</option>
</select>

<script>
Expand All@@ -12,7 +12,7 @@ The solution, step by step:
alert( selectedOption.value );

// 2)
let newOption = new Option("Classic", "classic");
let newOption = new Option("Класика", "classic");
genres.append(newOption);

// 3)
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,21 +2,21 @@ importance: 5

---

#Add an option toselect
#Додайте нову опцію до елемента `<select>`

There's a `<select>`:
Маємо `<select>`:

```html
<select id="genres">
<option value="rock">Rock</option>
<option value="blues" selected>Blues</option>
<option value="rock">Рок</option>
<option value="blues" selected>Блюз</option>
</select>
```

Use JavaScript to:
Використовуючи #"b1472f4c50de243ec4f934c7fdce2d2bee7eed3eac71c8a732a6e95cfb45ceaa">
1.Show the value and the text of the selected option.
2.Add an option: `<option value="classic">Classic</option>`.
3.Make it selected.
1.Виведіть значення та текст обраної опції.
2.Додайте опцію: `<option value="classic">Класика</option>`.
3.Зробіть її обраною.

Note, if you've done everything right, your alert should show `blues`.
Зверніть увагу: якщо ви все зробили правильно, то ваше сповіщення має показати значення `blues`.
Loading

[8]ページ先頭

©2009-2025 Movatter.jp