I'm trying to show the date of birth when the user puts their age, date and month will be current, for this example 12 here present age
var d = new Date();
var newdate = (d.getFullYear()-12)+'-'+(d.getMonth()+1)+'-'+d.getDate();
document.getElementById("age").value =newdate;
if I put the static values it shows on the HTML field (age)
document.getElementById("age").value ="2022-04-09";
but also if I try to change the input type from date to text then it shows the value