Skip to content
Advertisement

Get selected value in dropdown list using JavaScript

How do I get the selected value from a dropdown list using JavaScript?

JavaScript

Advertisement

Answer

Given a select element that looks like this:

JavaScript

Running this code:

JavaScript

Results in:

JavaScript

Interactive example:

JavaScript
JavaScript
Advertisement