+ 1

Javascript date - document.body.innerHTML = hours+":"+mins+":"+secs;

what does the syntax document.body.innerHTML = hours+":"+mins+":"+secs; mean?

28th May 2018, 4:37 PM
ROBOKIT
ROBOKIT - avatar
2 Antworten
+ 3
What's mentioned above. Document refers to the html. Body is the body tags. innerHTML is the methods/inline code in html. Your taking the variables hours, mins, and secs and seperating them with ":" in that order.
28th May 2018, 5:41 PM
Apple Blossom
Apple Blossom - avatar
+ 2
BY USING THIS SYNTAX YOU ARE CHANGING OR SETTING CONTENT OF BODY TO DISPLAY TIME IN MENTIONED FORMAT.
28th May 2018, 4:48 PM
Meet Mehta
Meet Mehta - avatar