Question
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
Digital 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:
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 stopwatchStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started