Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Month Checker 3000</title>
  4. <h1><font face="verdana" color="green">Month Checker</font></h1>
  5.  
  6.  
  7. Month Number: <input type="text" id="myText">
  8. <button onclick="myFunction()">Go</button>
  9.  
  10. <script>
  11. function myFunction() {
  12. var month = document.getElementById('myText').value;
  13. if (month <= 12 && month > 0) {
  14. alert('Valid month entered! ');
  15. } else {
  16. alert('Invalid month entered! ');
  17. }
  18. }
  19. </script>
  20. </head>
  21. <h1><font face="verdana" color="green">Year of Birth</font></h1>
  22.  
  23.  
  24. Year of Birth: <input type="text" id="myText2">
  25. button onclick="myFunction2()">Go</button>
  26.  
  27. <script>
  28. function myFunction2() {
  29. var year = document.getElementById('myText2').value;
  30. if (year <= 2015 && year > 1990) {
  31. alert('yes! valid year! ');
  32. } else {
  33. alert('invalid year! ');
  34. }
  35. }
  36. </script>
  37.  
  38.  
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement