var ddd = new Date(); var day =ddd.getDate(); if(ddd.getMonth()<10){ var month = "0"+(ddd.getMonth()+1); } if(ddd.getDate()<10){ day = "0"+ddd.getDate(); } var datew = ddd.getFullYear()+"-"+month+"-"+day; var
需求:想设置Imput标签Date默认值为当前时间,通过JavaScript实现. <html> ...... <body> <input type="date" id="date_info" placeholder="请输入时间"/> ...... <script> $(document).ready(function () { var time = new Date(); var day = (