How To Create A Stopwatch Using JavaScript | Make Stopwatch With HTML, CSS And JavaScript

Поделиться
HTML-код
  • Опубликовано: 31 дек 2024

Комментарии • 137

  • @shifteditz06
    @shifteditz06 4 месяца назад +4

    15:20 Another way to add zeroes is by creating a single function which will work for every variable
    dislpayTime.innerHTML = ` ${paddedZeroes(hours)} : ${paddedZeroes(minutes)} : ${paddedZeroes(seconds)}`;
    function paddedZeroes(number){
    return (number < 10 ? "0" + "") + number;
    }

  • @design-0000
    @design-0000 2 месяца назад +1

    if someone has problems with the reset(), change it as follows: function watchReset() {
    seconds = 0;
    minutes = 0;
    hours = 0;
    displayTime.innerHTML = "00:00:00"
    clearInterval(timer)
    }

  • @leandrohenrique6056
    @leandrohenrique6056 2 года назад +15

    I'm Brazilian, and your videos are the best.

    • @GreatStackDev
      @GreatStackDev  2 года назад +2

      Thanks! 😃

    • @ShirajBikaner
      @ShirajBikaner 2 года назад +3

      i am indian, hlo nice to meet you

    • @Dr.smileclinic
      @Dr.smileclinic Год назад +2

      I'm தமிழன்..😎

    • @hakai935
      @hakai935 5 месяцев назад

      日本語についてはどうですか?

    • @hakai935
      @hakai935 5 месяцев назад

      彼はここにいない

  • @uzairparkar5622
    @uzairparkar5622 3 месяца назад

    You are saving a lot of ceiling fans sir. Your video helped me understand the logic behind this.

  • @talkingnpc
    @talkingnpc Год назад +3

    Needed a stopwatch for an exercise, this great tutorial helped me a lot, thanks!

  • @shubhammaurya3309
    @shubhammaurya3309 7 месяцев назад +2

    Thank you so much sir... Phle mai khud se bnane ki kosish kar reha tha mgr logic ban hi nhi reha tha... Ab smjh aa gya

    • @GreatStackDev
      @GreatStackDev  7 месяцев назад

      You're welcome. Thank you. 😊 Keep making more projects!

    • @Islamic.treasuress
      @Islamic.treasuress 3 месяца назад

      ​@@GreatStackDev source code please

  • @33_etc_adityachincholkar70
    @33_etc_adityachincholkar70 3 месяца назад +2

    one of the easiest tutorial I have ever seen on RUclips

  • @cristianferreira3350
    @cristianferreira3350 2 года назад +2

    Happy New Year!!! thank you for all you do for us! god bless you!

  • @tihamicodes
    @tihamicodes 9 месяцев назад

    I have been following your videos and all of the videos are so much help full keep going 😁

  • @Gopal8055
    @Gopal8055 2 года назад +1

    Sir i watch all your videos which is so helpful for me

    • @GreatStackDev
      @GreatStackDev  2 года назад

      Thanks Gopal, glad you liked this tutorial to make stopwatch using javascript

    • @Islamic.treasuress
      @Islamic.treasuress 3 месяца назад

      ​@@GreatStackDev ​ source code please

  • @dennisdarko3197
    @dennisdarko3197 2 года назад +1

    I am really impressed with you presentation sir

    • @GreatStackDev
      @GreatStackDev  2 года назад

      Thanks a lot, Glad you liked this tutorial to make stopwatch using javascript

    • @Islamic.treasuress
      @Islamic.treasuress 3 месяца назад

      @@GreatStackDev source code please

  • @konstantinreut2577
    @konstantinreut2577 Год назад

    I am thankful to you for your lessons.

  • @mayankcharan1688
    @mayankcharan1688 Год назад

    Loved your work you have done fantastic job .very easy to understand concept.well done ❤❤

  • @albina272
    @albina272 Год назад +6

    Thank you this was an awesome video and a great idea for a project! I followed your steps and created my own version! :)
    Request: Could you please do a part at the end of each project guiding us on how to make it responsive?
    Thank you very much!

    • @GreatStackDev
      @GreatStackDev  Год назад +5

      Thank you for your comment, All videos has different purpose, this video was for making stop watch using JavaScript. I don't want to make my video in long duration. You can learn the responsive concept in my other videos. Please check: ruclips.net/video/0YFrGy_mzjY/видео.html

    • @Islamic.treasuress
      @Islamic.treasuress 3 месяца назад

      @@GreatStackDev source code please

  • @CHIKKUGAMER-su1bx
    @CHIKKUGAMER-su1bx 10 месяцев назад

    Great one sir, nice explanation

  • @govindsharma973
    @govindsharma973 Год назад

    Bro you are awesome❤❤ thanks yrr

  • @mahmodsamir5110
    @mahmodsamir5110 Год назад

    best and simple explanation ever

  • @salwacoding5661
    @salwacoding5661 11 месяцев назад

    Thank you vary helpful toturial.

  • @quantyquanty3724
    @quantyquanty3724 2 года назад

    Happy New Year. Looking forward to an interesting and creative one. Much has been said about ChatGPT but I am sure this channel with last. God Bless.

  • @zeeshanahmad789
    @zeeshanahmad789 2 года назад

    Simple and good explanations.
    Easy to understand.
    Awesome 👍🏻

    • @GreatStackDev
      @GreatStackDev  2 года назад

      Thanks Zeeshan, glad you liked this tutorial to make Stopwatch using JavaScript

    • @Islamic.treasuress
      @Islamic.treasuress 3 месяца назад

      @@GreatStackDev source code please

  • @nodiramatchanova1493
    @nodiramatchanova1493 2 года назад

    your tutorials helps me a lot

  • @HD-op1pe
    @HD-op1pe Год назад

    Thank you so much for this. Exactly what I needed.

  • @mahimapandey1195
    @mahimapandey1195 Год назад +1

    very good explanation! please make more complicated javascript projects as well

    • @GreatStackDev
      @GreatStackDev  Год назад

      here is the best 30 JavaScript project, you will love it: ruclips.net/p/PLjwm_8O3suyOgDS_Z8AWbbq3zpCmR-WE9

    • @Islamic.treasuress
      @Islamic.treasuress 3 месяца назад

      @@GreatStackDev source code please

  • @TahaBolat-sn6ib
    @TahaBolat-sn6ib Год назад +2

    Thank you for this video it is amazing!! But i've come to an issue that when you click start button it wasn't restarting so i figured out this issue with adding timer = null after clearInterval(timer) function. Because the timer wasn't null after clearInterval() function so i couldn't setInterval() again. If anyone has this issue this is the solution. Also dont forget to add timer = null after every clearInterval() function :)

  • @lukekoletsios3236
    @lukekoletsios3236 Год назад

    thank for you for the video! Very helpful sir.

  • @vikisneakers
    @vikisneakers Год назад

    Learnt alot, thanks man

  • @akSingh_120
    @akSingh_120 9 месяцев назад

    nice concept. I liked it ..

  • @BhupenderGupta-t6m
    @BhupenderGupta-t6m Год назад

    Thanks!
    it Helped

  • @ashishkabirpanthi5540
    @ashishkabirpanthi5540 Год назад +1

    ❤❤❤

  • @telmafarida7642
    @telmafarida7642 Год назад

    Hello, love the video it is simple and easy to comprehend. I however have an issue with the start button, when clicked more than once the function executes again making it execute after every 500 milliseconds. This now prevents the timer from being null so all other buttons do not work. Please offer some guidance.

  • @abelreddy257
    @abelreddy257 Год назад

    Great video. I was wondering why do we have to use timer variable.

  • @abkyerima
    @abkyerima 2 года назад

    God bless you sir

  • @SahilKumar-yx2ev
    @SahilKumar-yx2ev 7 месяцев назад

    thanks man god bless you always keep it up

  • @isamsvideoediting4572
    @isamsvideoediting4572 2 года назад +2

    Hello Avinash, Can you please make a detailed tutorial only on CSS

  • @patty_d.4773
    @patty_d.4773 2 года назад

    Thank you so much!

  • @dadi_vlogs3254
    @dadi_vlogs3254 Год назад +1

    HI man, lots of thanks for what you offer here.
    I have a question bro : what is the purpose of using this condition :
    if(timer !== null) {
    clearInterval(timer);
    };

  • @ghadykeyrouz1116
    @ghadykeyrouz1116 10 месяцев назад

    Thank you!

  • @saadlasharii
    @saadlasharii 4 месяца назад

    Not given that how does the play button changes into pause button and then back into play button when the start or stop the timer??

  • @marceloquiroga9052
    @marceloquiroga9052 Год назад

    great Tutorial!!!!

  • @sandwicheems
    @sandwicheems Год назад

    Cool project!

  • @adityadhanani828
    @adityadhanani828 Год назад

    Amazing it works

  • @Vkvk-y3u
    @Vkvk-y3u 6 месяцев назад

    Clearinterval in watch star functuon when timer is not null how its work can you explain this on. Because clearinterval stop the time which one used in watchstop function also.

  • @arjun_mavnoor
    @arjun_mavnoor Год назад

    Thank You

  • @tehniyatansari1614
    @tehniyatansari1614 Год назад

    Very helpful

  • @iamuzzalhossen
    @iamuzzalhossen 7 месяцев назад

    thanks a lot!

  • @falcongold2024
    @falcongold2024 Год назад

    8:20 js

  • @Ghulammustafa-wg6cy
    @Ghulammustafa-wg6cy 2 года назад

    Thanks Sir
    love from Pakistan

  • @ArfaYounus186
    @ArfaYounus186 Год назад

    thank you sir

  • @abubakerhaider
    @abubakerhaider Год назад +1

    please someone clarify why he set the variable timer to null and why he used it in watchStart function
    if(timer !== null){
    clearInterval(timer);
    }

    • @harshkochar2345
      @harshkochar2345 10 месяцев назад

      there is an Alternative for that

    • @harshkochar2345
      @harshkochar2345 10 месяцев назад

      function watchStart() {
      if (timer == null || timer.paused) {
      timer = setInterval(stopwatch, 1000);
      }
      }

    • @LinesofLove
      @LinesofLove 8 месяцев назад

      This code ensures that if a timer interval has been set previously (meaning timer is not null), it will be cleared to avoid any potential conflicts or unintended behavior.

  • @users9722
    @users9722 Год назад

    yeah but the setInterval function fires immediately not after you click the start button

  • @shivanshagrawal3285
    @shivanshagrawal3285 4 месяца назад

    I don't know why but the "onlick" isn't working in this one so i tried adding event listener and it worked

  • @gknomics
    @gknomics Год назад

    hey man i have a little issue that when I start the watch it says undefined

  • @Allinone-ew4df
    @Allinone-ew4df 2 года назад

    Hello Avinash Sir,
    I am Arpit and i am getting a probelem in this vedio at the time 02:02 you said that you will close the browser and open it with VSCode extention but i didn't understand that thing and when i thought that i will refresh the browser manually so it was not working .
    So could you please help me that how could you do that thing i watch all your vedios and in all your vedios i get same probelem .
    So please help me

    • @vibestation23
      @vibestation23 2 года назад

      just throw the folder into vs code and turn on live sever

    • @Allinone-ew4df
      @Allinone-ew4df 2 года назад

      I tried that also but i dont know how to throw the browser aand when i am right clicking so the live server option is also not coming

    • @GreatStackDev
      @GreatStackDev  2 года назад +1

      Hi Arpit, Just search for "VS Code live server" on RUclips and watch any video, you will understand it

    • @Allinone-ew4df
      @Allinone-ew4df 2 года назад

      Ok thanks

  • @thenameisraju1052
    @thenameisraju1052 2 года назад +1

    Please create calculator video with using javascript

    • @GreatStackDev
      @GreatStackDev  2 года назад

      here it is: ruclips.net/video/cGgLHJGyS34/видео.html

  • @nirushetty5530
    @nirushetty5530 Год назад

    👏👏

  • @KhanKhan-wf2zm
    @KhanKhan-wf2zm 2 месяца назад

    sir i have a problem when a start my stopwatch than it run but when i stop timer than want to restart the timer it will not start again

    • @design-0000
      @design-0000 2 месяца назад

      function watchReset() {
      seconds = 0;
      minutes = 0;
      hours = 0;
      displayTime.innerHTML = "00:00:00"
      clearInterval(timer)
      }

  • @UnthinkableFairytales
    @UnthinkableFairytales 2 года назад

    Could microseconds be added ?

    • @GreatStackDev
      @GreatStackDev  2 года назад +1

      in settimeinterval add 0.001 that will count at 1 microsecond. then desirably other value also in H1
      hours : minutes : seconds : milliseconds : microseconds

  • @Amman_vellore_angalammanthunai
    @Amman_vellore_angalammanthunai 2 года назад

    Hi bro I am Indian create website upload to localhost to webhosting open phone not view full screen what append bro

  • @youtubeuser32i
    @youtubeuser32i Год назад

    Hey Avinash, Please Give me this StopWatch Full Code.

  • @raven.4815
    @raven.4815 Год назад +1

    Hi man, this was pretty useful to a project of mine, but I have a doubt, what is the meaning of "let [seconds, minutes, hours] = [0,0,0]", does it create 3 different arrays? Thx!

  • @jamesross5120
    @jamesross5120 2 года назад

    I dont understand how you can remember everything to do with javascript its really hard to remember what goes where and how functionality works.

    • @GreatStackDev
      @GreatStackDev  2 года назад +3

      I also don't remember everything, sometimes i have search too. But by creating some small project like this you will remember the common features

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @allanbranson4693
    @allanbranson4693 4 месяца назад

    any ones else timer displaying three digits instead of two?

  • @hiwotina26
    @hiwotina26 2 года назад

    Doesn't the hour have infinite counting?

  • @itwithaydin9000
    @itwithaydin9000 2 года назад

    can you share code here?

    • @GreatStackDev
      @GreatStackDev  2 года назад +2

      Sorry, I can't put the code link in public, People just download it and close the video without watching it, Then what's the use of making video tutorials, if you really want to learn please watch the video then try to make it yourself, if you get any issue you can email me [avinashdm@outlook.com]

  • @surafelfikadu4331
    @surafelfikadu4331 2 месяца назад

    ... 💚💛❤🙏

  • @21avinashsrivastava10
    @21avinashsrivastava10 Год назад +3

    This code is not working 😕

  • @Kim-d2u
    @Kim-d2u 11 месяцев назад

    3.Feb.24

  • @richardgideon4959
    @richardgideon4959 2 года назад

    WTF!?

  • @firaasantar4503
    @firaasantar4503 Год назад

    Quit being a RUclips your bad at it I fell asleep 3 times trying to follow this tutorial.

    • @cryptofolks67
      @cryptofolks67 3 месяца назад

      how is he responsible for YOUR failure ? he has more than a million subscribers as in more than a million subscribers DISAGREE with you.

  • @petermwansa4890
    @petermwansa4890 11 месяцев назад

    Thank you

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

  • @Top5WithRhyme
    @Top5WithRhyme 2 года назад

    How to create search engine plss

    • @moondhaka
      @moondhaka 2 года назад

      You need to know a Programming language like Java,Python

    • @nurudeennajeem6605
      @nurudeennajeem6605 2 года назад

      Mail me I will send it to you