您的位置:首页 > 其它

文本框默认当天日期显示

2014-12-24 17:27 176 查看

//1.定义一个日期函数

function CurentTime()

{

var now = new Date();

var year = now.getFullYear(); //年

var month = now.getMonth() + 1; //月

var day = now.getDate(); //日

var clock = year + "-";

if(month < 10)

clock += "0";

clock += month + "-";

if(day < 10)

clock += "0";

clock += day + "";

return clock;

}

//2.文本框

$("#start").val(CurentTime());

<s:text name="effectdate"></s:text>:</div></td><td colspan="3"><input id="start" type="text" onclick="WdatePicker()" name="systemnotice.startDate"/>

//3.图片效果

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐