Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get selected text of html dropdown in javascript

var e = document.getElementById("selectElementID");
var value=e.options[e.selectedIndex].value;// get selected option value
var text=e.options[e.selectedIndex].text;
Comment

PREVIOUS NEXT
Code Example
Javascript :: three.js sphere 
Javascript :: javascript change webpage title 
Javascript :: js difference between two numbers 
Javascript :: clz32 
Javascript :: js remove object from array by value 
Javascript :: get parameter from next.js route 
Javascript :: check if letter is uppercase javascript 
Javascript :: add a route to a buttoin in angular 
Javascript :: javascript generate random string 
Javascript :: find min value in array javascript 
Javascript :: detect os javascript 
Javascript :: set autofocus javascript 
Javascript :: redirect in jsp 
Javascript :: install react with old version of node 
Javascript :: javascript round float 
Javascript :: pagecontrol 
Javascript :: javascript sort array of objects by date 
Javascript :: read file with deno 
Javascript :: js get first element by class 
Javascript :: passport.initialize() middleware not in use 
Javascript :: javascript detect click outside element 
Javascript :: js id style backgroundColor change 
Javascript :: regex expression dd/mm/yyyy javascript 
Javascript :: insertion sort javascript 
Javascript :: javascript print subarray from index to indeex 
Javascript :: document.ready shorthand 
Javascript :: install tailwind nextjs 
Javascript :: string to number js 
Javascript :: Check if a JavaScript string is a URL 
Javascript :: ref schemas mongoose error 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =