Java script

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>

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;

Age: <input type="text" id="input1" size="4"/> 

<button onclick="myFunction();" type="button">Eligible?</button>

<p id="result"></p>


if (Age < 18)

where did you define Age? i don’t see it being defined anywhere

I’d been looking at the code too long. I fixed it eventually. Thanks though :slight_smile: