Display time : Date : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » Date »

 

Display time





<html>
<head>
<script type="text/javascript">
var timer = null

function start(){
    var time = new Date()
    var hours = time.getHours()
    var minutes = time.getMinutes()
    minutes=((minutes < 10"0" ""+ minutes
    var seconds = time.getSeconds()
    seconds=((seconds < 10"0" ""+ seconds
    var clock = hours + ":" + minutes + ":" + seconds
    document.forms[0].display.value = clock
    timer = setTimeout("start()",1000)
}
</script>
</head>
<body onload="start()">
<form>
<input type="text" name="display" size="20">
</form>
</body>
</html>

           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» Date