$(document).ready(function () {
var time = new Date();
var day = ("0" + time.getDate()).slice(-2);
var month = ("0" + (time.getMonth() + 1)).slice(-2);
var today = time.getFullYear() + "-" + (month) + "-" + (day);
$('#element').val(today);
})
设置input日期选择框默认显示当前日期
最新推荐文章于 2024-10-08 14:08:32 发布