<!DOCTYPE html> <html> <head> <script> function selectedValue() { var index = document.getElementById("myValue").selectedIndex; var value = document.getElementById("myValue").options[index].text; alert(value); } </script> </head> <body> <form> Select your favorite Subject: <select id="myValue"> <option>PHP</option> <option>HTML</option> <option>JQuery</option> <option>Javascript</option> </select> </form> <button type="button" onclick="selectedValue()">Selected Value</button> </body> </html>
Wednesday, July 17, 2013
Get selected value of dropdownlist
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment