首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

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

2012-01-12 
在JavaScript中如何实现时间的改变在JavaScript中如何实现时间的改变,例如:有txtbox1和txtbox2当txtbox1中

在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>

热点排行