⊗jsPmSlSOG 414 of 504 menu

Getting the selected option in JavaScript

Using everything learned, you can get the selected option tag as follows:

let select = document.querySelector('#select'); console.log(select[select.selectedIndex]);

Given a select and a button. By pressing the button, display the text of the marked list item.

Given a select and a button. Add an exclamation mark to the end of the selected item text when you click the button.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline