<div class="htmlarea"> <textarea id="runcode94369"> <title>자바스크립트 테스트</title> <select id="month" onchange="setDay()"> <option value="1"> </option>1월<option value="2"> </option>2월<option value="3"> </option>3월<option value="4"> </option>4월<option value="5"> </option>5월<option value="6"> </option>6월<option value="12"> </option>12월</select> <select id="day"> </select> </textarea> <br><input onclick="runEx('runcode94369')" type="button" value="运行代码"><input onclick="doCopy('runcode94369')" type="button" value="复制代码"> <input onclick="doSave(runcode94369)" type="button" value="保存代码"> <a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">[Ctrl A 모두 선택 참고: </a>외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다 </div>]<script type="text/javascript"> function setDay() { var themonth=document.getElementById("month"); var themaxmonthday=31; if(themonth.value=="2") { themaxmonthday=28; } var theday=document.getElementById("day"); var tempdaylength=theday.options.length; for(var j=tempdaylength;j>0;j--) { theday.options.remove(j); } for(var i=1;i<=themaxmonthday;i++) { var theOption=document.createElement("option"); theOption.innerHTML=i+"日"; theOption.value=i; theday.appendChild(theOption); } } </script>