I just wanted to make a simple clock that tells you the time and not date. The problem with the code below though is that it shows the exact time of when the .html file is opened.
<body onload="showTime()">
<p id="time"</p>
<script>
var seconds;
var minutes;
var hours;
var time;
function showTime() {
seconds = getSeconds();
minutes = getMinutes();
hours = getHours();
document.getElementById("demo").innerHTML =
hours +":"+ minutes +":"+ seconds;
}
Is there anyway I could allow it to update automatically every second? Thanks.