Entry level javascript that I'm trying to finish. Unfortunately my lack of skills won't let me. I know there's working prototypes of this program out but but I want to learn rather than just copy someone elses work. Thanks
<html>
<head>
<title> 1 </title>
<style type="text/css">
body {
background-color:black;
color:white;
</style>
</head>
<body>
<h1><b> Calculator </h1></b>
<form id="timeForm">
<table>
<tr>
<td>Years:</td>
<td><input type="text" id="years" value="" size="10"></td>
</tr>
<tr>
<td>Months:</td>
<td><input type="text" id="months" value="" size="10"></td>
</tr>
<tr>
<td>Day:</td>
<td><input type="text" id="days" value="" size="10"></td>
</tr>
<tr>
<td> </td>
<td><input type="button" id="button" value="Submit" onclick="handleInput();"></td>
</tr>
</table>
</form>
<p id="output"></p>
<script language="Javascript">
document.getElementById("output").innerHTML = output;
}
function handleInput() {
var form = document.getElementById("timeForm");
try {
var strYears = form.years.value;
var strMonths = form.months.value;
var strDays = form.days.value;
var intYears = parseInt(strYears);
var intMonths = parseInt(strMonths);
var intDays = parseInt(strDays);
if (isNaN(intYears);
throw "Incorrect input. Years is not a number.";
if (intYears > 0 || intYears < 9999)
throw "Incorrect input. Years is out of expected range (0--9999).";
if (isNaN(intYears);
throw "Incorrect input. Months is not a number.";
if (isNaN(intMonths);
throw "Incorrect input. Months is not a number.";
if (intMonths > 0 || intMonths < 9999)
throw "Incorrect input. Months is out of expected range (0--9999).";
if (isNaN(intDays);
throw "Incorrect input. Days is not a number.";
if (intYears > 0 || intDays < 9999)
throw "Incorrect input. Months is out of expected range (0--9999).";
if (m == 1 | | m == 2) {
m = m + 12;
Y = Y - 1;
}
h = (q + Math.floor(13 * (m + 1) / 5) + Y + Math.floor(Y / 4)
- Math.floor(Y / 100) + Math.floor(Y / 400)) % 7;
{
var output = "Weekday" = " + years + ":" + months + ":" + days + ".";
catch (error) {
document.getElementById("output").innerHTML = "ERROR: " + error;
}
}
</script>
</body>
</html>