Digital clock code
I have written this code and it's failing to run what did I do wrong this is the code: <!DOCTYPE html> <html> <head> <title>Digital Clock</title> <script> setInterval(function(){ var currentTime = new Date(); var hours = currentTime.getHours(); var minutes = currentTime.getMinutes(); var seconds = currentTime.getSeconnds(); var period ="AM"; if(hours >= 12){ period ="PM"; } if(hours > 12){ hour = hours - 12; } if(minutes < 10){ minutes = "0"+minutes; } if(seconds < 10){ seconds = "0"+seconds; } var clockTime = hours ":" + munutes ":" + seconds " " + period; var clock = document.getElementById('clock'); clock.innerText ='clockTime'; },1000); </script> </head> <body> <div id="clock"></div> </body> </html>