by @kodeazy

How to get selected value from select Tag using Jquery,Javascript

Home » Javascript » How to get selected value from select Tag using Jquery,Javascript

To get the selected option we have to add a function, which calls every time the drop down is changed.

<select id="option" onchange="getSelectedOption();">
  <option>Select-option</option>
  <option>1</option>
  <option>2</option>
</select>

After Selecting the Drop Down getSelectedOption() function is executed.

 function getSelectedOption(){
       var optionNumber=$('#option').val();
       console.log(optionNumber);

    }

Here $('#option').val() function is executed and the value is shown in console.log()