input type date set date code example
Example 1: how to set a date for type date inpt
<input type="date" id="start" name="trip-start" value="2018-07-22">
Example 2: set date input html using js
document.getElementById("datePicker").valueAsDate = new Date()