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 :: mean vs mern stack 
Javascript :: Javascript Regex for non-negative numbers 
Javascript :: js-cookie set expiration of cookie 
Javascript :: es6 create array with increasing number 
Javascript :: remove symbols from cpf js 
Javascript :: javascript object remove empty properties 
Javascript :: javascript element distance from top 
Javascript :: js iterate match indexes 
Javascript :: nodejs array buffer to buffer 
Javascript :: javascript get all child elements 
Javascript :: xmlhttprequest error handling 
Javascript :: return more than 1 value from function js 
Javascript :: ckeditor check if empty 
Javascript :: js enum 
Javascript :: javascript atualizar pagina 
Javascript :: check if element is visible or hidden in dom 
Javascript :: angular toaster 
Javascript :: html form post json example 
Javascript :: js order string 
Javascript :: assign class to element javascript 
Javascript :: js get first letter of string 
Javascript :: is var is not blank then display value in javascript 
Javascript :: javascript colab connect 
Javascript :: readystate in ajax 
Javascript :: javascript refresh page 
Javascript :: javascript style font size 
Javascript :: javascript get month string 
Javascript :: google places autocomplete just cities 
Javascript :: regex expression for password validation form validation 
Javascript :: jquery table each rows with class 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =