Skip to content

Commit

Permalink
5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixtr committed Feb 4, 2024
1 parent 9eeaf58 commit 08bd2f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions js/clock.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const clock = document.querySelector("h2#clock");

function sayHello() {
console.log("hello");
function getClock() {
const date = new Date();
clock.innerText = `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
}

setInterval(sayHello, 5000);
getClock();
setInterval(getClock, 1000);
2 changes: 1 addition & 1 deletion js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/>
<input type="submit" value="Log In" />
</form>
<h2 id="clock">00:00</h2>
<h2 id="clock">00:00:00</h2>
<h1 class="hidden" id="greeting"></h1>
<script src="js/greetings.js"></script>
<script src="js/clock.js"></script>
Expand Down

0 comments on commit 08bd2f3

Please sign in to comment.