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:

Convert and download html to pdf without saving file

28-10-2018 node js convert html to pdf pdf download pdf without saving

Detect AdBlock with JavaScript in my browser

30-07-2017 AdBlock javascript detect

Time Sorting Ascending or Descending Order in Javascript

19-07-2017 Javascript ascending order descending order

Sanitization in java sript

14-03-2017 sanitization java script

Send Mail in Node Js

21-02-2017 node js mail npm module