文本框默认当天日期显示

//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()); 
:

//3.图片效果

你可能感兴趣的:(Java编程)