JS 读取 下拉 选项值 SELECT

<%@ page language="java" pageEncoding="gb2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <script type="text/javascript">
   function selectOnchange(q)
   {
	 if(q.selectedIndex == 1)alert(document.getElementById('select').value);
   }
  </script>
  </head>
  <body>
    <form name="frm">
     <select name="select" onchange="selectOnchange(this)">
      <option value="opValue1"></option>
      <option value="opValue2">111111111</option>
     </select>
    </form>
  </body>
</html>

你可能感兴趣的:(java,html)