set value input date javascript

Solutions on MaxInterview for set value input date javascript by the best coders in the world

showing results for - "set value input date javascript"
Caden
06 Jan 2021
1var date = new Date();
2var currentDate = date.toISOString().substring(0,10);
3var currentTime = date.toISOString().substring(11,16);
4
5document.getElementById('currentDate').value = currentDate;
6document.getElementById('currentTime').value = currentTime;