How to get selected value from Dropdown list in JavaScript

前端 未结 6 930
無奈伤痛
無奈伤痛 2020-12-28 16:17

How can you get the selected value from drop down list using JavaScript? I have tried the following but it does not work.

var sel = document.getElementById(\         


        
6条回答
  •  温柔的废话
    2020-12-28 16:37

    Here is a simple example to get the selected value of dropdown in javascript

    First we design the UI for dropdown

    Next we need to write script to get the selected item

    
    
                                     
                  
提交回复
热议问题