Reloj

HTML
<div id="hora"></div>
CSS
*{margin: 0; padding: 0} body{ background-color: #303030; } #hora{ border: 1px solid #00b5cc; background-color: #000000; padding: 10px; color: #00b5cc; font-size: 5em; width: 4em; margin: 5% auto; text-align: center; }
JAVASCRIPT
$(function(){ function mostrar_hora( ) { var d = new Date(); var h = d.getHours(); var m = d.getMinutes(); var s = d.getSeconds(); if(m < 10){ m = '0'+m; } if(s < 10){ s = '0'+s; } $('#hora').html(h + ":" + m + ":" + s); } setInterval(function(){mostrar_hora();}, 1000); mostrar_hora(); })
Expand for more options Login