0

What is wrong with this code

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible"Content="IE=edge> <meta name ="viewport" content="width=device-width, initiate> <title>Digital Clock </title) (/head> (body> I <div id="clock"></div> <script> setInterval(()=>{ let date =new Date () let clock =document.getElementById('clock') clock.innerHTML= date.getHours()+":"+ date.getMinutes()+":"+ date.getSeconds()+":"+ },1000); </script> </body> </html>

10th Mar 2023, 7:26 AM
Tanmoy Chakrabortty
Tanmoy Chakrabortty - avatar
2 Answers
+ 5
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible"Content="IE=edge> <meta name ="viewport" content="width=device-width, initiate> <title>Digital Clock </title> </head> <body> <div id="clock"></div> <script> setInterval(()=>{ let date =new Date (); let clock =document.getElementById('clock'); clock.innerHTML= date.getHours()+":"+ date.getMinutes()+":"+ date.getSeconds()+":"+ },1000); </script> </body> </html> I think the typo mistake, and in the script tag your mistake in javascript code, now attempt yourself to javascript code.
10th Mar 2023, 7:37 AM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar
+ 5
Tanmoy Chakrabortty Use code playground to execute and it will be helpful to attach with your question.
10th Mar 2023, 11:50 AM
R🍁🇼🇳
R🍁🇼🇳 - avatar