This article mainly introduces JavaScript to get the current value of select Sample code (compatible ie/firefox/opera/chrome) need friends can come to the reference, I hope to help you
JavaScript gets the current value of select: var value = document.getElementById ("select"). Options[document.getelementbyid ("select"). Options.selectedindex].value; var text = document.getElementById ("select"). Options[document.getelementbyid ("select"). Options.selectedindex]. Text Example: The code is as follows: <script> function check () {var select = document.getElementById ("select"). Options[document.getelem Entbyid ("select"). Options.selectedindex].value; alert (select); } </script> <select name= "Select" id= "select" > <option value= "test1" selected= "selected" >test1</ option> <option value= "test2" >Test2</option> </select> <input type= "button" value= "I'll try." onclick= "Check ()"/>