求一 html 下拉列表框
要求:
列表框里的内容为2000年到当前年份加1年
[解决办法]
方法1:javascript
<html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>无标题页</title></head><body style="margin:0"> <div> <select id="Select1" style="z-index: 102; left: 233px; position: absolute; top: 95px"> <option selected="selected"></option> </select> </div> <script type="text/javascript" language="javascript"> var d=new Date(); for (i=2000;i<=d.getFullYear();i++) { var option=document.createElement("option"); document.getElementById("Select1").options.add(option); option.innerText=i; option.value=i; } </script> </body></html>
[解决办法]
这个有难度吗?lz不会是课上的练习不做偷懒吧