1 <input type="date" id="date_info" placeholder="請輸入時間"/> 2 3 ...... 4 5 <script> 6 $(document).ready(function () { 7 var time = new Date(); 8 var day ...
1 <input type="date" id="date_info" placeholder="請輸入時間"/> 2 3 ...... 4 5 <script> 6 $(document).ready(function () { 7 var time = new Date(); 8 var day = ("0" + time.getDate()).slice(-2); 9 var month = ("0" + (time.getMonth() + 1)).slice(-2); 10 var today = time.getFullYear() + "-" + (month) + "-" + (day); 11 $('#date_info').val(today); 12 }) 13 </script>