Following is the Coding of stopwatch.which will generate only the seconds in the textbox and with start/stop and reset button.It's coding is written in the java script within html. HTML: <html> <HEAD> <SCRIPT LANGUAGE= "JavaScript"> var sec = 0; var secc = 0; function setinterval() { if (secc == 0) { secc= 1; a = new Date(); a.setTime(a.getTime() - sec); } else { secc = 0; cur = new Date(); sec= cur.getTime() - a.getTime(); document.watch.time.value = sec ; } } function treset() { secc = 0; sec= 0; document.watch.time.value = sec ; } function display() { setTimeout("display()", 100); if (secc== 1) { cur = new Date(); sec = cur.getTime() - a.getTime(); document.watch.time.value = sec; } } </script> </head> <BODY onLoad="display()"> <FORM NAME="watch"> <input type ="text" Name="time"> <input type="button" Name="button" VALUE="Start/Stop" onClick="setinterval()"> <input type="button" NAME="reset" VALUE="Reset" onClick="treset()"> </FORM> </body> </html>