To set the value of a input hidden field through JavaScript, we set the input’s value
property.
For instance, we write
document.getElementById("checkyear").value = "1";
to select the input with getElementById
.
Then we set its value
property to the input value.