<SCRIPT LANGUAGE="JavaScript">
<!--
function foo(){
var $s="";
for(var $i=1940;$i<=2004;$i++){
for(var $j=1;$j<=12;$j++){
$m=($j.toString().length<2)?(0+$j.toString()):$j;
$s+="<option value=\""+$i+$m+"\">"+$i+"Äê"+$m+"ÔÂ"+"</option>";
}
}
document.write($s);
}//-->
</SCRIPT>
<select>
<script>foo();</script>
</select>
<!--
function foo(){
var $s="";
for(var $i=1940;$i<=2004;$i++){
for(var $j=1;$j<=12;$j++){
$m=($j.toString().length<2)?(0+$j.toString()):$j;
$s+="<option value=\""+$i+$m+"\">"+$i+"Äê"+$m+"ÔÂ"+"</option>";
}
}
document.write($s);
}//-->
</SCRIPT>
<select>
<script>foo();</script>
</select>
解决方案 »
- firefox 下使用history.back();location.reload()不正常
- 发了个基于jQuery的表单验证
- 请各位高手帮忙,不是普通的图片无缝滚动问题!分不够,再另开贴加!今日急等,感激不尽!!
- 请问编写JavaScript用什么编译器比较好
- extjs4.0.7 tabPanel切换的问题
- html页面里掉用vb做的active控件,msgbox正常弹出,但是printer打印时出现错误!!!
- 表单问题
- 实在不懂写,所以向高手求助,谢谢!
- 如何用javascript操作文件
- 代码BUG求修改
- 如何在select的onchange()事件中撤销更改?
- 在不同的分辨率下怎样固定层的位置?
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>无标题文档</TITLE>
<SCRIPT language="javascript">
<!--
function showShortDate(name,bDate,eDate){
this.beginDate=bDate;
this.endDate=eDate;
this.show=createShorDate;
this.name=name;
if(!this.beginDate){
this.beginDate=1900;
}
if(!this.endDate){
this.endDate=2004;
}
}
function createShorDate(){
document.write("<SELECT name=\""+this.name+"\">")
for(var i=this.beginDate;i<=this.endDate;i++){
for(var j=1;j<=12;j++){
var tempJ=j.toString();
if(tempJ.length==1){
tempJ="0"+tempJ;
}
document.write("<OPTION value=\""+i.toString()+tempJ+"\">"+i.toString()+"年"+tempJ+"月</OPTION>");
}
}
document.write("</SELECT>")
}
//-->
</SCRIPT>
</HEAD><BODY>
<SCRIPT language="javascript">
<!--
var selDate=new showShortDate("selName");
// selDate.beginDate=1800;
// selDate.endDate=2012;
selDate.show();
var selDate=new showShortDate("selName");
// selDate.beginDate=1800;
// selDate.endDate=2012;
selDate.show();
//-->
</SCRIPT>
</BODY>
</HTML>