Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how-to get selected value of a dropdown menu in reactjs

....
const [currentValue, setCurrentValue] = useState(2);
<select id = "dropdown" value={currentValue} defaultValue={currentValue}>
     <option value="N/A">N/A</option>
     <option value="1">1</option>
     <option value="2">2</option>
     <option value="3">3</option>
     <option value="4">4</option>
  </select>
.....

setTimeut(()=> {
 setCurrentValue(4);
}, 4000);
Comment

PREVIOUS NEXT
Code Example
Javascript :: nodejs delete s3 folder 
Javascript :: javascript insert element after 
Javascript :: define an unsigned int js 
Javascript :: what is currying in javascript 
Javascript :: loop through an array in js 
Javascript :: js object loop 
Javascript :: how to make a div appear onclick 
Javascript :: select in react with nchange 
Javascript :: jquery get duration video tag 
Javascript :: create csv file nodejs 
Javascript :: change select value jquery 
Javascript :: javascript regex reference 
Javascript :: yarn incompatible module node 
Javascript :: run onclick function once js 
Javascript :: date masking javascript to not allow / 
Javascript :: js is undefined or null 
Javascript :: hover material ui styles 
Javascript :: sort js 
Javascript :: getdisplaymedia screenshot 
Javascript :: axios middleware 
Javascript :: how make date object in jquery from custom date 
Javascript :: anagram javascript example 
Javascript :: how to return a factorial in javascript 
Javascript :: react native create apk 
Javascript :: get option value jquery 
Javascript :: memory leak in javascript 
Javascript :: electron new window 
Javascript :: active navbar in page reactjs 
Javascript :: generate numbers from 1 to 100 to array 
Javascript :: recursion in javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =