I hope this is kinda clear to you all.
I have a form where I add some hidden parameters, I also want to add the hostname in such a field.
<input type="hidden" id="URL" value="www.xxxx.xx" name="URL" />
However, I can get the hostname, for example via this JS:
document.getElementById("URL").innerHTML =
window.location.hostname;
But in this way I only get it via the ID, which won't work to get it as a value.
Do you have any idea how to get that filled in?
Thanks, Eelco
Add it to the value of the element
document.getElementById("URL").value = window.location.hostname;