¹æ¹®°´ÀÌ ¹æ¹®ÇÑ ½Ã°£À» ±âÁØÀ¸·Î ¾ó¸¶³ª ¸Ó¹°°í ÀÖ´ÂÁö¸¦ ½Ã°£À¸·Î ³ªÅ¸³»´Â ½ºÅ©¸³Æ®ÀÔ´Ï´Ù.
Script Example |
<HTML> <HEAD>
<SCRIPT>
startday = new Date();
clockStart = startday.getTime();
function initStopwatch() {
var myTime = new Date();
var timeNow = myTime.getTime();
var timeDiff = timeNow - clockStart;
this.diffSecs = timeDiff/1000;
return(this.diffSecs); }
function getSecs() {
var mySecs = initStopwatch();
var mySecs1 = ""+mySecs;
mySecs1= mySecs1.substring(0,mySecs1.indexOf("."))
+ " secs.";
document.forms[0].timespent.value = mySecs1
window.setTimeout('getSecs()',1000); }
</SCRIPT> </HEAD>
<BODY onload="window.setTimeout('getSecs()',1)">
<CENTER> <FORM><FONT
size=2>¸Ó¹«¸¥ ½Ã°£:</FONT> <INPUT name=timespent
size=9></FORM> </CENTER>
</BODY> </HTML> |
|
|
¼³¸í |
½Ã°£ÀÌ ½Ç½Ã°£À¸·Î º¯ÇÏ´Â °ÍÀ» ¾Ë ¼ö ÀÖ½À´Ï´Ù. form ű׸¦ ÀÌ¿ëÇؼ
±× ¾È¿¡ µé¾î°¥ ³»¿ëÀ» ½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇؼ »Ñ·ÁÁÖ´Â ¹æ½ÄÀÔ´Ï´Ù. |
|
|
|
|