Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Homework</title>
- <style type="text/css">
- body{
- background: black;
- }
- #inputhelp{
- font-size: 60px;
- color: white;
- width: 320px;
- height: 70px;
- margin: 0 auto;
- margin-top: 170px;
- }
- #inputbox{
- width: 185px;
- height: 20px;
- margin: 0 auto;
- margin-top: 20px;
- }
- #yearaccept{
- width: 185px;
- }
- #yearaccept:active{
- background: red;
- }
- #buttonbox{
- width: 185px;
- height: 20px;
- margin: 0 auto;
- margin-top: 10px;
- }
- #futurebox{
- font-size: 50px;
- width: 500px;
- height: 500px;
- border-radius: 3px;
- display: flex;
- justify-content: center;
- align-items: center;
- background: black;
- color: black;
- margin: 0 auto;
- margin-top: 40px;
- }
- </style>
- <script type="text/javascript">
- function save(){
- var text = document.getElementById("inputyear").value;
- if (text < 2019) {
- alert('Вы в прошлом')
- }
- else if (text >= 2019) {
- document.getElementById('futurebox').style.color = 'white';
- document.getElementById('futurebox').style.background = '#FF0000';
- }
- else{
- alert('Ошибка! Введите число')
- }
- }
- </script>
- </head>
- <body>
- <div id="inputhelp">Введите год</div>
- <div id="inputbox">
- <input id="inputyear" value="">
- </div>
- <br>
- <div id="buttonbox">
- <button id="yearaccept" onclick="save()">Подтвердить</button>
- </div>
- <div id="futurebox"> Back to the Future</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement