dcsimg

Lesson 38: The Script and Its Effect



The Script

<SCRIPT LANGUAGE="javascript">

function RunningTime() {
var RightNow = new Date()
var hr = RightNow.getHours()
var min = RightNow.getMinutes()
var sec = RightNow.getSeconds()

var printIt = "Time: " +hr+ ":" +min+ ":" +sec

document.clock.clockface.value = printIt

setTimeout("RunningTime()","1000")

}
</SCRIPT>

<FORM NAME="clock">
<INPUT TYPE="text" name="clockface">
</FORM>

 

The Script's Effect

 

Back to the Index Page