Exercise Javascript (somehow Object Oriented)
Javascript Timer class
We have the JavaScript class Date() which has the method getTime().Create a new JavaScript class called
Timer with the following "methods" (or at least functions).:start()stop()lap()returns the elapsed time without stoping the chronometergetTimer()returns the sum of the elapsed timereset()reinitialized the elapsed time to 0
HTML Page
Write a html page containing four buttons:- Start
- Stop
- Reset
- Lap
getTimer() (when the timer is stopped) and the current value returned by the last lap() if one was used.
Related Pages
Contact
Prof. Dr. Emmanuel Benoist
Berner Fachhochschule - TI
Quellgasse 21
CH-2501 Biel/Bienne
Switzerland
Mail: emmanuel.benoist (at) bfh.ch
Berner Fachhochschule - TI
Quellgasse 21
CH-2501 Biel/Bienne
Switzerland
Mail: emmanuel.benoist (at) bfh.ch
Social Networks
Follow
me
on
Linkedin, Scholar
& Research gate