2016-12-04 70 views
-5

中顯示時鐘我正在一個項目中嘗試在容器內顯示時鐘,以便時鐘響應。我希望有人能指導我如何去做。在HTML頁面或Div

下面是我嘗試顯示相同的HTML頁面。

<!DOCTYPE html> 
    <html lang="en"> 

    <head> 
     <meta charset="utf-8"> 
     <title> UA </title> 
     <meta name="description" content="EVERYTHING FINE"> 
     <!-- Latest compiled and minified CSS --> 
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> 

     <!-- Optional theme --> 
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> 

     <style> 
     .grey{ 
       background-color: #ccc; 
       padding: 20px; 

     } 
     </style> 

    </head> 

    <body> 

     <header> 
      <div class="jumbotron"> 
       <div class="container"> 
        <script> 
        ............ 
        </script> 
       </div> 
      </div> 
     </header> 

      <div class="grey"> 
       <div class="container"> 
        <div class="well">R&D</div> 
       </div> 
      </div> 



     <footer> 
      <div class="container"> 
       <hr> 

       <p> 
        <small><a href="http://hazratferozmemon.org/#/">Jump To TrueTasawwuf</a> TRUE TASAWWUF</small></p> 
       <!--<p> <small><a href="http://twitter.com/wiredwiki">Ask whatever </a> On Twitter</small></p>--> 
       <!--<p> <small><a href="http://youtube.com/wiredwiki">Subscribe me</a> On Youtube</small>--> 

       </p> 
      </div> <!-- end container --> 
     </footer> 

     <!-- Latest compiled and minified JavaScript --> 
     <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> 
    </body> 
    </html> 
+0

後,如果要插入一個div http://stackoverflow.com/時間內建立一個時鐘問題/ 18229022/how-to-show-current-time-in-the-format-h​​hmmss – Rajashekhar

+0

0

您可以使用您導入了jQuery
確保你把你的腳本jQuery腳本標籤

<script type="text/javascript"> 
$(document).ready(function(){ 
    var timer = setInterval(clock, 1) 
    function clock(){ 
     $(".demo").html(Date()); 

    } 

}); 
</script> 
<body> 
<p class="demo"></p> 
</body>