Make sure ALL the images are in a folder/directory called exactly "digital" and that it and the digitalclock.js file are in the same folder as the web page using the script. */
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>
function digitalclock(){ var x = new Date(); var s = x.getSeconds(); var m = x.getMinutes(); var h = x.getHours(); var the_time = ((h < 10)?"0"+h:h)+''+((m < 10)?"0"+m:m)+''+((s < 10)?"0"+s:s); for (i = 0; i < the_time.length; i++){ document.images[idx+"digits"+i].src = pics[the_time.charAt(i)].src; } setTimeout(digitalclock,100); } digitalclock(); })();