javascript get selected option
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 textlet selectElement = document.getElementById("selectElement");
let valueSelected = selectElement.options[selectElement.selectedIndex].value; // get selected option value
var text= selectElement.options[selectElement.selectedIndex].text; //get the selected option text
Also in JavaScript:
- refresh token undefined in google auth passport js
- jquery get element by id
- get current url react router
- adding cors parameters to extjs ajax
- get largest number in array javascript
- how to refresh a web page automatically in javascript
- javascript atualize array
- sequelize find one
- nodejs express routing
- how do i check if JQuery checkbox is checked
- jquery checkbox unchecked
- parsefloat jquery
- npm express-session
- javascript check string lenght
- javascript canvas gamma correction
- accèder data-id javascript
- detect a click outside an element javascript
- Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
- loop through javascript object
- iterate over json data javascript
- javascript get age
- vue js getter
- java script hash
- javascript foreach example