Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Month Checker 3000</title>
- <h1><font face="verdana" color="green">Month Checker</font></h1>
- Month Number: <input type="text" id="myText">
- <button onclick="myFunction()">Go</button>
- <script>
- function myFunction() {
- var month = document.getElementById('myText').value;
- if (month <= 12 && month > 0) {
- alert('Valid month entered! ');
- } else {
- alert('Invalid month entered! ');
- }
- }
- </script>
- </head>
- <h1><font face="verdana" color="green">Year of Birth</font></h1>
- Year of Birth: <input type="text" id="myText2">
- button onclick="myFunction2()">Go</button>
- <script>
- function myFunction2() {
- var year = document.getElementById('myText2').value;
- if (year <= 2015 && year > 1990) {
- alert('yes! valid year! ');
- } else {
- alert('invalid year! ');
- }
- }
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement