JSFiddle - React, Tailwind, and code Playground
by frogggeee McFrogggeee
HTML
<!DOCTYPE html>
<html>
<head>
<body>
<h1 id = "clock"></h1>
<canvas id = "canvas" width = "50" height = "50"></canvas>
<script>
let pics = "12345";
let pic = "";
let count = 0;
let ct= document.getElemenById("canvas").getContext("2d");
function render() {
if (count > pics.length - 1) {
count = 0;
}
pic = pics.charAt(count);
count++;
document.getElementById("clock").innerHTML = pic;
}
setInterval(render, 100);
</script>
</body>
</head>
</html>