Making Digital Clock in JavaScript

in Hindwhale Community15 days ago


Hello Friends

How are you all Hope everyone is well. I'm fine too. Today I have come to you with a beautiful tutorial. And that is how you can make a digital clock through programming. This is a tutorial made with my talent, coding skills, hope you like it. Let's share the tutorial with you step by step.

This tutorial is divided into three steps in total. And that is:-
  • HTML Part
  • CSS Part
  • JavaScript Part
HTML

HTML means Hyper Text Markup Language. First I have a file named "index.html" inside a folder. Then open this file in "VS CODE" and code inside it like the above screenshot. Here create a folder named CSS for CSS and inside it create a CSS file "style.css". And link to "index.html" as style. And create a folder named js for JavaScript. And create a file named "main.js" inside it. And link to "index.html" through script tag. And the body tag doesn't have a div tag for the clock.


CSS

For the clock through HTML, I took the div named .clock and designed it with CSS. Here we design the body first. Position, colour, text size, bold text, letter distance, background colour, padding, border radius etc. are designed for clock.


JavaScript

JavaScript does not have a function called showTime(). Then inside this function hours, minutes, seconds, and sessions are not included in separate variables. Then there are some conditions to show the time properly. Let's pass the time generated through our JavaScript to the id MyClockDisplay which we have given an id with HTML. And reload the function every second with setTimeout(showTime, 1000). And with that done, our desired digital clock.

So friends, I have shared with you step by step how to make a digital clock. Thanks everyone for reading the post. Hope everyone likes the post. And if you have any comment you can tell through comment.

❤️️Thank you all❤️️

Sort:  
Loading...

Congratulations!


Your post has been upvoted by our Steem4Professionals community curation account @hive-117276. Subscribe to our Steem4Professionals Community & start your journey by sharing your daily working activities, skills, tutorial, learning all exclusive things and many more and participate in all the amazing ongoing contests.


Here are some ongoing contests JOIN QUICKLY. 👉Contest // Wk-07 // Let's learn and teach, expand the scope of knowledge.),👉CONTEST ALART: What do you know about work ethics?, 👉Contest || Week-3 || Share a small business idea for new entrepreneurs., 👉📢📢 Contest: Safety First in the Workplace.,

GIF_20240319_083439_879.gif

Join Steem4Professionals Community

I invite you all to support @pennsif & @pennsif.witness to grow across platforms through strong communication at all levels and targeted high-yield development with available resources.

Click Here

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.029
BTC 56373.71
ETH 2972.37
USDT 1.00
SBD 2.12