/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<form name=form0> <select name="selectFormName" onchange=getValueSelected()> <option value="Test A">Test A</option> <option value="Test B">Test B</option> <option value="Test C">Test C</option> </select> </form> <br/><br/> <script> function getValueSelected(){ var x = document.form0.selectFormName.selectedIndex; alert(document.form0.selectFormName.options[x].value); }; </script