Yo ninjas, in this tutorial I want to teach to you the amazingness of JavaScript timers :). Timers are used all over the show in JavaScript, in anything from popup forms to image sliders. They are a cool feature of JavaScript and well worth mastering if you want to create slightly more advanced interactivity!

The functions we use for JavaScript timers are:


Any questions, just ask 🙂


========== JavaScript for Beginners Playlist ==========

========== CSS for Beginners Playlist ==========

========== HTML for Beginners Playlist ==========

========== The Net Ninja ============

For more front-end development tutorials & to black-belt your coding skills, head over to – or

========== Social Links ==========

Twitter – @TheNetNinja –


  1. great video !! Thank you !
    I have a question , in the end of the demo, after storing the interval function into variable myTimer, you did not call the interval function ( only assigned variable to it) , but the color still changes after you refresh the page . can anyone tell me why?

  2. Let us say when you clicked on the color to stop the cycling, if you wanted your "Timer stopped" text to be in the middle of the color box how would you go about doing that?

  3. Great tutorials so far man, very helpful. I just have a question for the css portion here. where u have two paddings what does the second one represents? is the first one hight and second one from right. and also the margin, why u have 0 and auto. is zero for the top and auto for centring it?


Please enter your comment!
Please enter your name here