This assignment asks you to write a script for a clock that tells the time in San Francisco, New York, London, and Tokyo. The clock should have a text field for the time, a button to update the clock, and four radio buttons, one for each of those time zones. When you click on one of the radio buttons, the correct time should appear in the text field. When you click on the update button, the clock should update with the time from the zone you've selected with the radio buttons.

This solution has two main functions: updateClock() is called when the update button is clicked, and updateReadout() is called when one of the time zone radio buttons is clicked.

<html><head><title>Chapter 7 Assignment</title> <script type = "text/javascript"> <!-- ...

Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.