Answers for "set default date today js"

0

set default date today js

$(document).ready( function() {
    var now = new Date();
 
    var day = ("0" + now.getDate()).slice(-2);
    var month = ("0" + (now.getMonth() + 1)).slice(-2);

    var today = now.getFullYear()+"-"+(month)+"-"+(day) ;


   $('#datePicker').val(today);
});
Posted by: Guest on October-12-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language