<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>工时</title>
</head>
<body>
<input type="text" size="10" id="start_day">
<span>日</span><br/>
<input type="button" value="Get Time" onclick="get_code()"/>
<script type="text/javascript">
var myarr=new Array();
myarr=[01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]
var start_day=document.getElementById(start_day);
function get_code()
{
for (var i=start_day;i<31;i++){document.write("time:"+myarr[i]+"<br/>")}
}
</script>
</body>
</html>var i=start_day的意思是,我想从我指定的日期开始,但这个指定的日期是不确定的哪天。是否可以这么写?
添加回答
举报
0/150
提交
取消