var date = new Date();
var currentDate = date.toISOString().substring(0,10);
<input id="dob" type="date" value="<?php echo date("Y-m-d"); ?>">
document.getElementById("dob").value = "2021-02-09";
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = now.getFullYear() + "-" + month + "-" + day;