const hourEl = document.getElementById("hour") const minuteEl = document.getElementById("minutes") const secondEl = document.getElementById("seconds") const ampmEl = document.getElementById("ampm") function updateClock(){ let h = new Date().getHours() let m = new Date().getMinutes() let s = new Date().getSeconds() let ampm = "AMPM" if(h > 12){ h = h- 12 ampm = "PM" } h = h<10 ? "0" + h : h; m = m<10 ? "0" + m : m; s = s<10 ? "0" + s : s; hourEl.innerText = h; minuteEl.innerText = m; secondEl.innerText = s; ampmEl, (innerText = ampm); setTimeout(()=> { updateClock() }, 1000) } updateClock();
Coder Blocks is a drag-and-drop visual programming language that is designed to make coding accessible and fun for people of all ages. With Coder Blocks, users can create their own programs and games without needing to know traditional programming concepts like syntax and variables. Instead, they use blocks, similar to puzzle pieces, that represent different actions or commands. One of the key features of Coder Blocks is its intuitive and user-friendly interface. Users can easily drag and drop