JS get select option value
var e = document.getElementById("selectElementID");
var value=e.selectElement.options[e.selectedIndex].value;// get selected option value
var text=e.options[e.selectedIndex].text;//get the selected option text
Also in JavaScript:
- in java javascript what is source code
- How to write on a web page javascript
- primitive and non primitive data types in javascript
- javascript detect click outside element
- match height jquery
- tolowercase
- p5js click on button
- javascript set file input value to null
- cambiar background image javascript
- how to push multiple data to different parents in a single request in firebase
- javascript load image programmatically
- new date() in javascript 3 days from now
- js invert color
- immutable values
- ar.js getting started
- get url query params js
- react map gl marker offset
- how to block special characters in javascript
- show loading spinner while page loads angularjs
- background image with styled components
- javascript generate random color site:stackoverflow.com
- discord.js say command embed
- set class name javascript
- capitalize in javascript