日期:2014-05-20 浏览次数:20695 次
---------------------------JS------------------------------- <script type="text/javascript"> function getValue(){ var val = document.getElementById("testId").value; alert(val); } </script> ------------------------JSP--------------------------------- <form name="form2" action="" method="post"> <table> <tr> <td> <select id="testId" name="testName"> <option value="0"/>please select <option value="1"/>America <option value="2"/>China <option value="3"/>England <option value="4"/>Japan <option value="5"/>Canada </select> </td> <td><input type="button" onclick="getValue()" value="click me to get the select value"/></td> </tr> </table> </form>