1. Home
  2. Computing & Technology
  3. JavaScript

Day of Week Image
Introduction

By Stephen Chapman, About.com

One way that you can have your web page to changed when a visitor returns a day or two later is to display a different image on your page depending on the day of the week. How do we do that? Well by using Javascript to grab the day from your visitors computer and then selecting one of serveral images to display based on that day.

This Javascript code uses seven images to represent the different days of the week. You can use whatever images you like, the only limitation is that all of the images will need to be the same size.

Let's begin by looking at a sample page which shows the image that appears at this time of the day.

Explore JavaScript
About.com Special Features

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

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

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

All rights reserved.