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