i remember i have written a tutorial on making a clock using javascript before but i know that it was not explained and that codes were not clean so i thought make it again with nice codes . first we need to create a html document to make a the javascript codes work or make the javascript functions work so go ahead and create a new html document and type the regular html tags and under head tag add these codes
now close the head tag and start the body tag now put these codes there
now close the body tag and check your html page boom ! a small digital clock in javascript ! you can also use some awesome css and some other things to make this beautiful !