Show Clock with javaScript

GOOD morning everybody !!!!

In this moment I will share about show clock

with javaScript.

Hehe... is so simple and saving time


okey the first we must make html file


example.html

<HTML>
<HEAD>
<TITLE>.:: Clock ::.</TITLE>
</HEAD>
<BODY>

</BODY>
</HTML>


after that put this Javascript

in head section in the HTML code

<SCRIPT Language="JavaScript">

<!--

var timerID = null;



function showtime(){

var today=new Date()

document.CLOCK.ALARM.value=today.toLocaleString()

TimerID=setTimeout("showtime()",1000)

}

// -->

</SCRIPT>

and than create form input

<FORM name="CLOCK"><INPUT name="ALARM" TYPE="TEXT" SIZE=20 VALUE=""></FORM>

and this is the full code:

<HTML>

<HEAD>

<TITLE>.:: Clock ::.</TITLE>

<SCRIPT Language="JavaScript">

<!--

var timerID = null;



function showtime(){

var today=new Date()

document.CLOCK.ALARM.value=today.toLocaleString()

TimerID=setTimeout("showtime()",1000)

}

// -->

</SCRIPT>

</HEAD>

<BODY onLoad="showtime()">

<BR><CENTER>

<FORM name="CLOCK"><INPUT name="ALARM" TYPE="TEXT" SIZE=20 VALUE=""></FORM>

</CENTER>

</BODY>

</HTML>

and Done.


Thanks.

DAn



Posted by Danivan7 | at Wednesday, October 15, 2008

0 comments: