+ 1

How to place js content (date object) inside an HTML element..basically a div container...?!!

18th May 2020, 3:08 PM
✨ Muviee ✨
✨ Muviee ✨ - avatar
5 Answers
+ 1
Html :- <div id="clock"></div> JS:- var det= document.getElementById("clock"); det.innerHTML(datText);
18th May 2020, 3:13 PM
Abhay
Abhay - avatar
+ 1
Any doubt
18th May 2020, 3:13 PM
Abhay
Abhay - avatar
+ 1
<div id="time"></div> <script type="text/javascript"> var c=new Date(); var a=c.getHours(); var b=c.getMinutes(); document.getElementById("time").innerHTML=""+a+","+b+""; </script>
18th May 2020, 3:19 PM
Abhay
Abhay - avatar
+ 1
Hey thanq soo much.. it worked...
18th May 2020, 3:43 PM
✨ Muviee ✨
✨ Muviee ✨ - avatar
0
Dude it's throwing an error.. showing... getElementById isn't a function
18th May 2020, 3:30 PM
✨ Muviee ✨
✨ Muviee ✨ - avatar