Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Hello world</title>
- <style type="text/css">
- .block {
- background-color: aquamarine;
- width: 400px;
- position: absolute;
- height: 50px;
- margin-left: 34%;
- margin-top: 5%;
- }
- .current_day {
- height: 100%;
- position: absolute;
- margin-left: 6%;
- width: 18%;
- }
- .current_time {
- position: absolute;
- height: 100%;
- margin-left: 30%;
- width: 18%;
- }
- .current_seconds {
- position: absolute;
- height: 100%;
- margin-left: 53%;
- width: 18%;
- }
- .current_year {
- height: 100%;
- position: absolute;
- margin-left: 77%;
- width: 18%;
- }
- .update_time {
- border: 0px;
- padding-bottom: 10px;
- padding-left: 10px;
- padding-top: 10px;
- font-family: monospace;
- font-size: x-large;
- background-color: chartreuse;
- box-shadow: 0px 0.5px 3px black;
- margin-left: 42%;
- margin-top: 10%;
- }
- </style>
- <script type="text/javascript" src="jquery-3.2.1.min.js">
- $(function(){
- $('button').bind('click', function() {
- var current = new Date();
- $('.current_day').text(current.getDate());
- $('.current_time').text(current.getHours());
- $('.current_seconds').text(current.getSeconds());
- $('.current_year').text(current.getYear(););
- });
- });
- </script>
- </head>
- <body>
- <div class="block">
- <div class="current_day"></div>
- <div class="current_time"></div>
- <div class="current_seconds"></div>
- <div class="current_year"></div>
- </div>
- <button class="update_time">Обновить время</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement