Step by step procedure Implementing about JavaScript Timer

Timer Demo:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>

<html xmlns=””>


<title>Validation On Submit</title>

<script language=”JavaScript”>

function showClientTime() {

var dt = new Date()

spnTime.innerHTML = dt.toLocaleTimeString();

setTimeout(“showClientTime ()”, 1000);




<body onload=”showClientTime()”>

<span id=”spnTime”></span>



To show and close window:

<script type=”text/JavaScript”>

var win;

function ShowWindow() {

win =“JS1.htm”, “win1”, “menubar=no,scrollbars=no,width=400,height=500,location=no,resizable=yes”)


function CloseWindow() {





Code for displaying time

document.write(“<span id=’spnTime’></span>”)

function setClientTime() {

document.getElementById(“spnTime”).innerHTML = new Date().toTimeString();

setTimeout(“setClientTime()”, 1000)



In any HTML Page, add the following to show System time:

<script type=”text/JavaScript” src=”ShowTime.js”></script>



Leave a Reply