Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.66 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>Hello world</title>
  6.     <style type="text/css">
  7.         .block {
  8.             background-color: aquamarine;
  9.             width: 400px;
  10.             position: absolute;
  11.             height: 50px;
  12.             margin-left: 34%;
  13.             margin-top: 5%;
  14.         }
  15.         .current_day {
  16.             height: 100%;
  17.             position: absolute;
  18.             margin-left: 6%;
  19.             width: 18%;
  20.         }
  21.         .current_time {
  22.             position: absolute;
  23.             height: 100%;
  24.             margin-left: 30%;
  25.             width: 18%;
  26.         }
  27.         .current_seconds {
  28.             position: absolute;
  29.         height: 100%;
  30.         margin-left: 53%;
  31.         width: 18%;
  32.         }
  33.         .current_year {
  34.             height: 100%;
  35.             position: absolute;
  36.             margin-left: 77%;
  37.             width: 18%;
  38.         }
  39.         .update_time {
  40.             border: 0px;
  41.             padding-bottom: 10px;
  42.             padding-left: 10px;
  43.             padding-top: 10px;
  44.             font-family: monospace;
  45.             font-size: x-large;
  46.             background-color: chartreuse;
  47.             box-shadow: 0px 0.5px 3px black;
  48.             margin-left: 42%;
  49.             margin-top: 10%;
  50.         }
  51.     </style>
  52.     <script type="text/javascript" src="jquery-3.2.1.min.js">
  53.         $(function(){
  54.             $('button').bind('click', function() {
  55.             var current = new Date();
  56.             $('.current_day').text(current.getDate());
  57.             $('.current_time').text(current.getHours());
  58.             $('.current_seconds').text(current.getSeconds());
  59.             $('.current_year').text(current.getYear(););
  60.         });
  61.         });
  62.     </script>
  63. </head>
  64. <body>
  65. <div class="block">
  66.     <div class="current_day"></div>
  67.     <div class="current_time"></div>
  68.     <div class="current_seconds"></div>
  69.     <div class="current_year"></div>
  70. </div>
  71. <button class="update_time">Обновить время</button>
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement