Is it possible to print the current year inside an input value with javascript? PS.: I don't want to use the type="date" method. PS. 2: The value needs to be printed on the input as soon as the screen is opened.
var dateControl = document.querySelector('input.year[type="text"]');
dateControl.value = "getFullYear()";
<input type="text" id="year" value="">