So i have a form and as part of it you must enter in a date and a time with a datetime input, like so..
<form action="confirmForm.html">
<p>What date and time suits you? </p>
<input id="datetime" type="datetime-local" />
</form>
and then on the next page, there's just a span tag.
<body onload="formConfirm();">
<span id="confirm"></span>
</body>
And my JavaScript..
var test = document.getElementById('datetime').value;
document.getElementById("confirm").innerHTML = test;
I expected it to print the datetime to the span tag, but it does nothing. Tried it with alert(test); too but got nothing there either. Pretty confused about this.
Edit: oh and the form has a submit button and all that, forgot to include it here.