Hello sorry if this is a duplicate question but I was wondering if someone could help me out with my code I don't know what i'm missing i'm supposed to create a page that the user enters a age and it returns the result of the ticket prices.
Under age 5 entry is free Between ages 5 and 12 (inclusive) a child’s ticket costs $5.00 Older than 12 an adult ticket costs $9.00
Here's my code:
function myFunction() {
var age;
var older;
var young;
age = document.getElementById("age").value;
older = (age >= 13) ? "$9":"$5";
document.getElementById("demo").innerHTML = older + " movie";
}
<body>
<p>Input your age and click the button:</p>
<input id="age" />
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<p> Under age 5 entry is free
Between ages 5 and 12 (inclusive) a childís ticket costs $5.00
Older than 12 an adult ticket costs $9.00 </p>
<body>