Obținerea opțiunii selectate în JavaScript

Folosind tot ce am învățat, putem obține tag-ul option selectat în felul următor:

javascriptlet select = document.querySelector('#select');
console.log(select[select.selectedIndex]);
Задание 1

Este dat un element select și un buton. La click pe buton afișați textul elementului de listă selectat.

Задание 2

Este dat un element select și un buton. La click pe buton adăugați la sfârșitul textului elementului selectat un semn de exclamare.