日期:2014-05-16 浏览次数:20337 次
<script language="javascript"> function selectInput(choose) { alert(document.getElementById("month").value); } </script> <select name="month" id ="month" onchange="selectInput(this)"> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08" selected="selected">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select>
function selectInput(choose) { alert(choose.text); }
<script language="javascript"> function selectInput(choose) { var selectInput = document.getElementById("month") alert(selectInput .options[selectInput.selectedIndex].text); } </script> <select name="Month" onchange="selectInput(this)"> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08" selected="selected">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select>