javascriptGet selected option text of a dropdown (select) box
var sel = document.querySelector('select');
var selected = sel.options[sel.selectedIndex].text;ctrl + c| var sel = document.querySelector('select')selects needed  | var selectedwill contain selected option text | 
| sel.selectedIndexreturns selected option index | sel.optionsarray with  | 
More of Javascript
- Round to 1 decimal
- Toggle class of an element
- How to return to a previous page
- Get all children and grandchildren of an html element recursively
- Insert text into textarea at cursor position
- Access object key by variable
- Throw error
- Use variable as regex
- Get hostname by url
See more codes...