当前位置: 代码迷 >> ASP.NET >> 在JavaScript中怎么实现时间的改变
  详细解决方案

在JavaScript中怎么实现时间的改变

热度:5452   发布时间:2013-02-26 00:00:00.0
在JavaScript中如何实现时间的改变
在JavaScript中如何实现时间的改变,
例如:有txtbox1   和txtbox2  
当txtbox1中的时间改变时,txtbox2中的时间在txtbox1基础上加上3天????

------解决方案--------------------------------------------------------
去取到值,再加上3就可以了
------解决方案--------------------------------------------------------
<script type= "text/javascript ">
function a()
{
var now = new Date();
var yy = now.getYear();
var mm = now.getMonth()+1;
var dd=now.getDate();
var dd1=now.getDate()+3;
document.getElementById( 'TextBox1 ').value=yy+ "- "+mm+ "- "+dd;
document.getElementById( 'TextBox2 ').value=yy+ "- "+mm+ "- "+dd1;

}
</script>
  相关解决方案