1. Home
  2. Computing & Technology
  3. JavaScript

Analog Clock

2. The Head Script

clr gif
Join the Discussion

Questions? Comments?

More of this Feature

Introduction Add Clock Configuration

The script is now designed to be completely unobtrusive and so the script now has only two parts both of which go in the head section of your web page. The first part is the clock parameters. You need to select the code from the text box below (there is a highlight all button beneath it to make this easier) and copy it into a file called clockp.js. We'll get to what you need to change in this to display the clock the way that you want later.

The main head script is next. You need to select the code from the text box below (there is a highlight all button beneath it to make this easier) and copy it into a file called clockh.js.

You next attach the script into your web page that you wish to display your clock on by adding the following code into the head section of your page.

<script type="text/javascript" src="clockp.js">
</script>
<script type="text/javascript" src="clockh.js">
</script>

The next step is to attach the clock to your page

Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.