menu
vvcestudio.com.br/utilitarios
Visit other channels :

Digital Clock

Loading Digital Watch..
::
Codigo JS
x
var relDigSeconds = 0;
var relDigMinutes = 0;
var relDigHours = 0;
function getDate() {
var now = new Date();
relDigSeconds = now.getSeconds();
relDigMinutes = now.getMinutes();
relDigHours = now.getHours();
document.getElementById("digitalSeconds").innerHTML = relDigSeconds;
document.getElementById("digitalMinutes").innerHTML = relDigMinutes;
document.getElementById("digitalHours").innerHTML = relDigHours;
}
function iniciarRelogioDigital(){
document.getElementById("relogioDigiFundo").style.display = "block"; // Mostrar relogio.
document.getElementById("btLInitRelogDig").style.display = "none"; // Esconder botão de iniciar.
setInterval(getDate, 1000);
}
Codigo HTML
x
<div>
<a id="btLInitRelogDig" className="btLInitRelogDig" onClick={() => {iniciarRelogioDigital()}}>
<BtLink href="" value={lingua("Iniciar Relogio Digital","Start Digital Watch")} estilo="grafite"/>
</a>
<div id="relogioDigiFundo" className="relogioDigiFundo">
<span id="digitalHours">{relDigSeconds}</span>:
<span id="digitalMinutes">{relDigMinutes}</span>:
<span id="digitalSeconds">{relDigHours}</span>
</div>
Codigo CSS
x
.btLInitRelogDig{
display: block;
}
.relogioDigiFundo {
text-align: center;
display: none;
background-color: #000000;
width: 150px;
color: #ACF0F2;
margin: 10px auto;
font-family: Verdana, Arial, Tahoma, Serif;
font-size:25px;
border-radius: 5px;
}