How to get drop down value when drop down change using javascript

onchange
events
dropdown
javascript
functions

Here is the sample example to the get value from the drop down

 Here the code is 

<script>
function changeFunction(){
	var color = document.getElementById('color').value;
	alert(color);
}
</script>
<select onchange="changeFunction()" id="color">
<option value="black">Select Black</option>
<option value="red">Select Red</option>
<option value="blue">Select Blue</option>
<option value="green">Select Green</option>
</select>

 

You might also like:

Time Sorting Ascending or Descending Order in Javascript

19-07-2017 Javascript ascending order descending order

How to redirect one page to another page in php

20-03-2017 redirect php

How to make an http request in node js

14-03-2017 http module node js

How to get current date and time (yyyy-mm-dd H:i:s) using javascript

09-03-2017 javascript date time

Call a function every second or 5 seconds in javascript

22-02-2017 setinterval function calling