Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
JavaScript Exercise Countdown Timer
Rating: 4.5 out of 5(100 ratings)
3,860 students

JavaScript Exercise Countdown Timer

Explore how to apply JavaScript to create a countdown timer - Practice exercise for JavaScript
Created byLaurence Svekis
Last updated 11/2024
English
English [Auto],Korean [Auto],

What you'll learn

  • Create interactive JavaScript Countdown timer
  • Use JavaScript Date object and apply Logic

Course content

2 sections21 lectures1h 18m total length
  • Introduction JavaScript Countdown Timer Exercise2:17

    Build a JavaScript countdown timer from scratch, using local storage to persist the selected date across refreshes. Learn to manipulate the DOM and perform date calculations to display remaining time.

  • Setup HTML page elements7:35

    Set up a basic html page with linked css and javascript to build a countdown timer, including a date input and a dynamic days, hours, minutes, and seconds display.

  • Some CSS Styling for Countdown5:36

    Set up html with a linked stylesheet, center the text, and style the countdown timer with coral background, chocolate blocks, white text, and full-width display.

  • Source Code HTML and CSS0:20
  • JavaScript Countdown Variables6:02

    Learn to build a JavaScript countdown timer by selecting and updating page elements with query selectors and ids. Debug with console.log and use local storage to persist the end date.

  • Source Code JavaScript0:05
  • Event Listeners JavaScript4:10

    Learn to use event listeners in JavaScript to respond to end date input changes, prevent default, clear and reset intervals, and start a countdown using the date value from document.

  • Source Code JavaScript0:07
  • Starting the Clock JavaScript4:21

    Trigger the countdown by wiring an input change to start clock, passing the end date value. Update the timer every second with time remaining calculations and interval-driven counter updates.

  • Source Code JavaScript0:11
  • JavaScript Date Get Time Remaining6:38

    Calculate the time remaining by subtracting the current date from the end date, then convert to days, hours, minutes, and seconds with Math.floor and modulus, and output to HTML.

  • Update HTML elements JavaScript5:09

    Update the countdown timer by writing days, hours, minutes, and seconds into the HTML via innerHTML, pad to two digits with slice, and clear the interval when zero.

  • Source Code JavaScript0:17
  • Save Timer to LocalStorage4:04

    Store the countdown timer in local storage so the end date persists after refresh, using get item, set item, and converting to a date object for the input.

  • JavaScript Exercise Code Review6:47

    Review the JavaScript exercise code that builds a countdown timer by selecting DOM inputs, structuring the clock, and updating days, hours, minutes, and seconds. Starts the clock.

  • Project Source Code0:23

Requirements

  • Basic JavaScript knowledge
  • HTML and CSS experience
  • Desire to learn JavaScript

Description

JavaScript Practice Exercise - Learn to apply JavaScript to build a countdown timer from scratch!

Course demonstrates how to use JavaScript within a practice exercise, applying JavaScript to connect to HTML elements and user interactions.  Let the user select a date and JavaScript will return and output the amount of time left until that date is reached.   The countdown is displayed within the HTML elements, using JavaScript to manipulate the element content.  Scope of this course is to help outline the steps in logic to build with JavaScript code.  Planning and where to start to build.

Prefect course for beginners to learn JavaScript!!! Step by step learning with all steps included.  Fun and exciting way to learn and practice JavaScript. by applying what is presented in the lessons and building your own version of the applications.  Make it even better, style it and try out JavaScript.

Beginner JavaScript knowledge is required as the course covers only JavaScript relevant to the building of the countdown timer.  Also HTML and CSS knowledge is essential as scope of this course is all JavaScript focused.  

  • how to setup your HTML elements and CSS basic stlying
  • add event listeners for user interactions to invoke JavaScript functions
  • Use JavaScript Date Method calculate the date difference
  • Manipulate and update HTML elements using JavaScript
  • Store values in the browser local Storage for seamless loading of content

All this is included and a whole lot more.  

Along with friendly support in the Q&A to help you learn and answer any questions you may have.

Try it now you have nothing to lose, comes with a 30 day money back guarantee.  

Start building your own version of the countdown timer today!!!!

Who this course is for:

  • Anyone who wants to learn an practice JavaScript
  • Web developers
  • Beginners to JavaScript
  • Anyone who wants to learn more about using JavaScript