So I've been searching a lot here and on google, but can't seem to find the solution.
Onclick of a link, I need to empty the value of a hidden input field with a certain ID.
var x = document.getElementById('tijdelijke_datum');
document.getElementById("close-popup").onclick = verwijderdatum;
function verwijderdatum() {
x.value = "";
}
<a href="websitelink" id="close-popup">Button value</a>
<input type="hidden" id="tijdelijke_datum" value="{$profile.x}" />