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:

Remove last two characters from given string

06-03-2017 substring javascript remove

Navigate to another page using java script

06-03-2017 javascript redirection navigation

Filter for change Date Time format (MM-dd-yyyy HH:mm) in Angular Js

05-03-2017 mm-dd-yyyy HH:MM date formats angular js

How to change background color and color to the text using javascript

27-02-2017 css javascript colors

Get random strings from given string In javascript

21-02-2017 javascript random string