选择日期后怎样使他在jsp页面中显示出来
展开全部
JS内容
<script type="text/javascript">
var weeks=["日","一","二","三","四","五","六"];
function showTime(){
var date=new Date();
var y=date.getFullYear();
var m=date.getMonth()+1;
var d=date.getDate();
var w=date.getDay();
var h=date.getHours();
var mi=date.getMinutes();
var s=date.getSeconds();
var ms=m<10?"0"+m:m;
var ds=d<10?"0"+d:d;
var hs=h<10?"0"+h:h;
var mis=mi<10?"0"+mi:mi;
var ss=s<10?"0"+s:s;
var time=y+"年"+ms+"月"+ds+"日 "+hs+":"+mis+":"+ss+" 星期"+weeks[w];
document.getElementById("div_time").innerHTML=time;
setTimeout("showTime()",1000);
}
</script>
jsp页面内容
<div id="div_time" align="right"></div>
<script type="text/javascript">
var weeks=["日","一","二","三","四","五","六"];
function showTime(){
var date=new Date();
var y=date.getFullYear();
var m=date.getMonth()+1;
var d=date.getDate();
var w=date.getDay();
var h=date.getHours();
var mi=date.getMinutes();
var s=date.getSeconds();
var ms=m<10?"0"+m:m;
var ds=d<10?"0"+d:d;
var hs=h<10?"0"+h:h;
var mis=mi<10?"0"+mi:mi;
var ss=s<10?"0"+s:s;
var time=y+"年"+ms+"月"+ds+"日 "+hs+":"+mis+":"+ss+" 星期"+weeks[w];
document.getElementById("div_time").innerHTML=time;
setTimeout("showTime()",1000);
}
</script>
jsp页面内容
<div id="div_time" align="right"></div>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询