Im in my first year of uni and attempted to write some java script but it doesnt work. can anyone see why?
<h1> Eligibility </h1>
<script>
function myFunction() {
var x = parseFloat(document.getElementById("input1").value);
var greeting;
if (Age < 18) {
greeting = "Not Old Enough";
} else {
greeting = "Great! sign up";
}
document.getElementById("result").innerHTML = greeting;
}
</script>
Age: <input type="text" id="input1" size="4"/>
<button onclick="myFunction();" type="button">Eligible?</button>
<p id="result"></p>