Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please add a Timer App by modifying the source files of the Clock Application which is displayed below. The expected Output is below the source

Please add a Timer App by modifying the source files of the Clock Application which is displayed below. The expected Output is below the source code. Thanks

Source code for the Clock Application:

clock.js:

var $ = function(id) { return document.getElementById(id); }; var displayCurrentTime = function() { var today = new Date(); var h = today.getHours(); var m = today.getMinutes(); var s = today.getSeconds(); t = setTimeout(function() { displayCurrentTime() }, 500); var ampm = "AM"; if(h > 12) { h = h - 12; ampm = "PM"; } document.getElementById("hours").innerHTML = padSingleDigit(h); document.getElementById("minutes").innerHTML = padSingleDigit(m); document.getElementById("seconds").innerHTML = padSingleDigit(s); document.getElementById("ampm").innerHTML = ampm; }; var padSingleDigit = function(num) { return (num displayCurrentTime(); };

index.html

Clock

Digital clock

Clock

:

:

clock.css

body {

font-family: Arial, Helvetica, sans-serif;

background-color: white;

margin: 0 auto;

width: 450px;

border: 3px solid blue;

padding: 0 2em 1em;

}

h1 {

color: blue;

}

label {

float: left;

width: 11em;

text-align: right;

padding-bottom: .5em;

}

input {

margin-left: 1em;

margin-bottom: .5em;

}

fieldset {

margin-bottom: 1em;

}

//Clock and Timer App expected output\\ Displayed below:

image text in transcribed

Extra 7-2 Add a stopwatch to the Clock app Digital clock with stopwatch -Clock 3: 22: 57 PM Stop Watch Start Stop Reset 00: 12: 320 Add the JavaScript code for the stopwatch

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

ISBN: 0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

What is the law of diminishing control?

Answered: 1 week ago