I have a data validation program that I made in Javascript and it works fine, it basically shows extra information for a particular date such as, what day it was on, and other info.
My problem is I dont know how to put into the HTML tag.
Here is also a screenshot of my task:

var canvas;
canvas = openGraphics();
var day;
day=prompt( "Please enter your day of birth");
var month;
month = prompt( "Please enter your month of birth");
var year;
year = prompt( "Please enter your year of birth");
var date;
date = new Date( year, month-1,day);
if(true){
if(date.getFullYear()== year )
{
}
if( date.getMonth()== month-1 )
{
}
if( date.getDate()== day )
{
}
else{
alert( "Invalid Date" );
}
}
canvas.setFont( "Palatino Linotype", "24px", Font.PLAIN );
canvas.setColor("blue");
canvas.drawString( "Full DOB:", 10, 10 );
canvas.drawString( date, 100, 10 );
canvas.paint();
My attempted HTML so far, the is all wrong and I need someone to show me how to implement my code above into a html format:
<html>
<head>
<title>
Date Validation
</title>
<script>
function checkdate(){
var year = document.getElementById('year').value;
var month = document.getElementById('month').value;
var day = document.getElementById('day').value;
var date = new Date( year, month-1,day);
if(true)
{
if(date.getFullYear()== year )
if( date.getMonth()== month-1 )
if( date.getDate()== day )
}
else{
alert( "Invalid Date" );
}
</script>
<body>
<h1>Data Validation</h1>
<p> This page will be used to provide information on the specific date that you enter below. </p>
<form>
Day:
<input type = "text" input id="day" onchange = "checkdate();>
</form>
<form>
Month:
<input type = "text" input id="month" onchange = "checkdate();>
</form>
<form>
Year:
<input type = "text" input id="year" onchange = "checkdate();">
</form>
<form>
<input type="submit" value="Validate Date">
</form>
</body>
</html>