New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN: 9781305503922
Author: Patrick M. Carey
Publisher: Cengage Learning
Question
Book Icon
Chapter 9, Problem 8CP4

a)

Program Plan Intro

To declare a countdown() function, which will update the minsLeft, secsLeft, and timeLeft variables every second. This function should not have any parameters and it should calculate a new value for the minsLeft variable by dividing the timeLeft variable by 60 and using the Math.floor()method to round that value down to the next lowest integer in file ph_clock.js.

b)

Program Plan Intro

To calculate the new value for the secsLeft variable which is equal to the value of the timeLeft variable minus 60 times the minsLeft variable within the countdown()function in file ph_clock.js.

c)

Program Plan Intro

To create a minsString variable and setting its value equal to the value returned by the addLeadingZero() function by using minsLeft as the parameter value within the countdown()function in file ph_clock.js.

d)

Program Plan Intro

To create a secsString variable and setting its value equal to the value returned by the addLeadingZero() function by using secsLeft as the parameter value within the countdown()function in file ph_clock.js.

e)

Program Plan Intro

To change the text content to the value of the minsString variable within the element with the id minutes and to change the text content to the value of the secsString variable within the element with the id seconds within the countdown()function in file ph_clock.js.

f)

Program Plan Intro

To call the checkTimer()function within the countdown()function in file ph_clock.js.

g)

Program Plan Intro

To declare a decrement operator to decrease the value of the timeLeft variable by 1 within the countdown()function in file ph_clock.js.

Blurred answer
Students have asked these similar questions
Create a variable named data that stores the result of this equation, 10x + 2y.
Can you please help me fill out the Commands column? Thank you.
DO NOT COPY AND PASTE THE ANSWER THAT CHEGG HAS FOR THIS QUESTION. I HAVE ASKED THIS QUESTION TWICE, AND BOTH TIMES THE "EXPERT" COPIED AND PASTED THE ANSWER FROM CHEGG. PLEASE ACTUALLY SOLVE THIS PROBLEM, OR I'LL JUST HAVE TO CANCEL MY BARTLEBY SUBSCRIPTION. C++ Question  Hello, Please create the correct code for the attached picture. Please create the code based on the given requirements. Please make sure it is working, but please DON'T use the FLAG VARIABLE or any advanced functions. Thank you!
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage