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