Day 10 of #100daysofcode
As you can see, we have our
rootelement, followed by a
time variable that returns local time. Following that, we have a variable
element that displays our time in
div. The element is then rendered in
You can see that we have our code in
function tick and have
setInterval to run every second. The time will now be displayed appropriately without the need to reload the website.
You can notice that only our
time div is rendering repeatedly. Because only what has to be rendered over and again is rendered, our page does not slow down.
That's all for now.
If you found this useful, please follow me on Twitter at @Hxrshxd for more.