Hi
Do help me in this simple scenario .. The Below code works completely fine But the thing is required is
Requirement :
The line that prints out from my javascript function needs to print at the BOTTOM of the existing page, under the button. Nothing else on the page will change, and the user will not be taken to a new page at any time.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<title>Ernest Tee's Soccer Ticket Price</title>
<script type="text/javascript">
var age;
function getAge()
{ age=prompt("Enter Customer's Age");
if (age<5)
{ document.write("Cost of Ernest's ticket is $2.00");} //**********THIS IS WHAT I'M TALKING ABOUT
else if (age>=5 && age<=15)
{document.write("Cost of Ernest's ticket is $6.00");}//**********THIS IS WHAT I'M TALKING ABOUT
else if (age>15)
{document.write("Cost of Ernest's ticket is $8.00");}//**********THIS IS WHAT I'M TALKING ABOUT
}
</script>
</head>
<body>
<header>
<h1>Ernest Tee's Soccer Ticket Price</h1>
</header>
<p>This page will decide the cost of Ernest Tee's soccer ticket price based on his age.</p>
<p><h3>Click on the button below to enter Ernest's age</h3></p>
<div id="container1">
<ul>
<li>Under age 5 (age < 5) cost is $2.00 </li>
<li>Between ages 5 and 15 (5 ≥ age ≤ 15) cost is $6.00</li>
<li>Older than 15 (age > 15) cost is $8.00</li>
</ul>
<p><input type="button" value="Enter Ernest's Age" onclick="getAge();"></p>
<p></p>
<br>
</div>
</body>
</html>
Thank you