+ 1
How to create a digital clock
2 Answers
+ 7
Use the following code:
<h2 id="clock"></h2>
<script type="text/javascript">
var clock=document.getElementById("clock");
setInterval(function(){
var time=new Date();
clock.innerHTML=time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
},1000)
</script>
+ 7
This code may help you...
https://code.sololearn.com/Wvhqh0lrbEGM/?ref=app