set date in input type date

后端 未结 12 1506
广开言路
广开言路 2020-11-28 23:51

i will set today date in datepicker input type date in chrome.

$(         


        
12条回答
  •  生来不讨喜
    2020-11-28 23:52

        1 console.log(new Date())
        2. document.getElementById("date").valueAsDate = new Date();
    

    1st log showing correct in console =Wed Oct 07 2020 00:40:54 GMT+0530 (India Standard Time)

    2nd 06-10-2020 which is incorrect and today date is 07 and here showing 06.

提交回复
热议问题