Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get value of choice dropdown in js

var e = document.getElementById("ddlViewBy");
var strUser = e.options[e.selectedIndex].text;
Comment

JS get dropdown value

let selectedIndex = element.selectedIndex;
if (selectedIndex > -1) {
  let selectedOption = element.querySelectorAll('option')[selectedIndex];
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: nested for loop in angular 
Javascript :: how to do something once in javascript 
Javascript :: dynamodb count items node 
Javascript :: clear timeout js 
Javascript :: how to print json.stringify of nested objects 
Javascript :: new js 
Javascript :: how to get time zone difference date-fns 
Javascript :: declaring two variables inside for loop 
Javascript :: javascript regex insert string 
Javascript :: image react native base64 
Javascript :: creating javascript class 
Javascript :: how to get checkbox value in jquery 
Javascript :: The toString() Method 
Javascript :: array.sort 
Javascript :: Nuxt.js + Electron 
Javascript :: stringy 
Javascript :: JQuery .hasClass for multiple values in an if statement 
Javascript :: != javascript 
Javascript :: UnhandledPromiseRejectionWarning 
Javascript :: run javascript in atom 
Javascript :: boolean as string javascript 
Javascript :: chart.js on hover and onclick event 
Javascript :: airbnb and eslint react native 
Javascript :: table like another component in react native 
Javascript :: make a button who disable scrolling down the page react 
Javascript :: sequelize queryinterface select 
Javascript :: javascript create array 
Javascript :: jsonl parser javascript 
Javascript :: this keyword in javscript 
Javascript :: print console.log 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =