The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Extra 13-1Develop the Clock applicationÂ
Open the HTML and JavaScript files in this folder:
exercises_extrach13clock
1.In the JavaScript file, note that four functions are supplied. The $ function. The start of a displayCurrentTime function. The padSingleDigit function that adds a leading zero to single digits. And the start of an onload event handler.
2.In the displayCurrentTime function, add code that uses the Date object to determine the current hour, minute, and second. Convert these values to a 12 hour clock, determine the AM/PM value, and display these values in the appropriate span tags.
3.In the onload event handler, code a timer that calls the displayCurrentTime function at 1 second intervals. Also, make sure that the current time shows as soon as the page loads.
Extra 13-2 Add a stopwatch to the Clock app
Open the HTML and JavaScript files in this folder:
exercises_extrach13clock_stopwatch
1.code the attach, detach, and preventDefault methods of the event library.
2.In the tickStopwatch function, add code that increments the values in the elapsed object by 10 milliseconds. Then, add code that displays the result in the appropriate span tags in the page.
3.In the startStopwatch function, add code that starts the stopwatch. Be sure to cancel the default action of the link too.
4.In the stopStopwatch and resetStopwatch functions, add code that stops the stopwatch. Also, in the resetStopwatch function, reset the elapsed time and the page display. Be sure to cancel the default action of the link too.
5.In the onload event handler, attach the stopwatch event handlers to the appropriate links.
Attachments: