0
我希望1的日值僅在用戶選擇一個月而不是空白值時顯示,但它不工作......我認爲該函數是錯誤的。我希望當天的下拉菜單中只有在沒有選擇月份時才顯示。請幫助我....下拉隱藏值
<html>
<head>
<script type="text/javascript">
function show(x) {
var mon = document.getElementById(x).innerHTML
if (mon == "") {
document.getElementById("one").style.display="none";
} else {
document.getElementById("one").style.display="";
}
}
</script>
</head>
<body>
Calendar<br>
<hr align="left" width="200px"/>
--Year ------ Month ----- Day<br>
<select name="year">
<option value="defaulty"></option>
<option value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
</select>
<select name="month" onchange="show(this)">
<option id="defaultm"></option>
<option id="January">January</option>
<option id="February">February</option>
<option id="March">March</option>
<option id="April">April</option>
<option id="May">May</option>
<option id="June">June</option>
<option id="July">July</option>
<option id="August">August</option>
<option id="September">September</option>
<option id="October">October</option>
<option id="November">November</option>
<option id="December">December</option>
</select>
<select name="day">
<option id="defaultd" value="defaultd"></option>
<option id="one" value="one" style="display:none">1</option>
</select>
</body>
</html>