html set date input value to curent date code example Example: set date input html using js document.getElementById("datePicker").valueAsDate = new Date()