Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  
  5. <title>Homework</title>
  6.  
  7. <style type="text/css">
  8. body{
  9. background: black;
  10. }
  11. #inputhelp{
  12. font-size: 60px;
  13. color: white;
  14. width: 320px;
  15. height: 70px;
  16. margin: 0 auto;
  17. margin-top: 170px;
  18. }
  19. #inputbox{
  20. width: 185px;
  21. height: 20px;
  22. margin: 0 auto;
  23. margin-top: 20px;
  24. }
  25. #yearaccept{
  26. width: 185px;
  27. }
  28. #yearaccept:active{
  29. background: red;
  30. }
  31.  
  32. #buttonbox{
  33. width: 185px;
  34. height: 20px;
  35. margin: 0 auto;
  36. margin-top: 10px;
  37. }
  38. #futurebox{
  39. font-size: 50px;
  40. width: 500px;
  41. height: 500px;
  42. border-radius: 3px;
  43. display: flex;
  44. justify-content: center;
  45. align-items: center;
  46. background: black;
  47. color: black;
  48. margin: 0 auto;
  49. margin-top: 40px;
  50. }
  51. </style>
  52.  
  53. <script type="text/javascript">
  54. function save(){
  55. var text = document.getElementById("inputyear").value;
  56. if (text < 2019) {
  57. alert('Вы в прошлом')
  58. }
  59. else if (text >= 2019) {
  60. document.getElementById('futurebox').style.color = 'white';
  61. document.getElementById('futurebox').style.background = '#FF0000';
  62. }
  63. else{
  64. alert('Ошибка! Введите число')
  65. }
  66. }
  67. </script>
  68.  
  69. </head>
  70. <body>
  71.  
  72. <div id="inputhelp">Введите год</div>
  73. <div id="inputbox">
  74. <input id="inputyear" value="">
  75. </div>
  76. <br>
  77. <div id="buttonbox">
  78. <button id="yearaccept" onclick="save()">Подтвердить</button>
  79. </div>
  80. <div id="futurebox"> Back to the Future</div>
  81.  
  82. </body>
  83. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement