The code for this is relatively simple, as you can see if you look at the source for this file. In the head I’ve preloaded the image, which, from what I can tell is necessary. Second I’ve got all of the files I want and named them the same, with the exception of the digit indicating the Day of the Week. Hence the DOW (stands for Day Of Week) for the name followed by a digit followed by .jpg. This is so I don’t have to write out 8 (or 31 if you were ambitious enough to do this for each Day Of the Month) individual lines (actually it would be more like 16 lines). It also makes the code to replace the image much easier and shorter to write as well.
The code for the image is below, notice the ID tag, this is VERY important. Notice that there is no source file, so no image is loaded by default
<img id="DayOfWeek" src="" height="50px" width="50px" border="1"/> <img id="DayOfWeek2" src="" height="50px" width="50px" border="1"/>
And finally, the code to replace the images in the HTML code.
I hope you found this useful, I know I can think of uses for this. As always your mileage may vary.