Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" href="style.css">
- <title>Aaron Stockdale's Age Range Page</title>
- <script type="text/javascript">
- function andFunction()
- {
- var userAge = prompt("What's your age?", " ");
- if(userAge >= 16 && userAge <= 18)
- document.getElementById('age').innerHTML = "Age entered " + userAge + "is in range. Can play in youth team.";}
- else
- document.getElementById('age').innerHTML = "Age entered " + userAge + "is not in range. Can play not in youth team.";}
- }
- function orFunction()
- {
- var userAge = prompt("What's your age?", " ");
- if(userAge > 15 || userAge < 19)
- document.getElementById('age').innerHTML = "Age entered " + userAge + "is in range. Can play in youth team.";}
- else
- document.getElementById('age').innerHTML = "Age entered " + userAge + "is not in range. Can play not in youth team.";}
- }
- </script>
- </head>
- <body>
- <header>
- <h1>Aaron Stockdale's Age Range Check</h1>
- </header>
- <section>
- <br><p>This page will prompt Aaron for his age to check if he can play in the youth team.</p>
- <h2>Click on the button below to enter Aaron's age</h2>
- <p><input type="button" id="button1" style="border:2px solid #6A959D" value="Enter age and compare with AND operator"
- onclick="andFunction()"/>
- <p><input type="button" id="button1" style="border:2px solid #6A959D" value="Enter age and compare with OR operator"
- onclick="orFunction()"/>
- </section>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement