DEMONSTRATION :
Affichage d'une horloge :
INSTALLATION DU SCRIPT :
Le code à insérer dans la partie
<HEAD>
et
</HEAD>
:
<SCRIPT Language="JavaScript"> <!-- /************************************************************************* * APPLICATION : Affichage d'une horloge * * RECUPERE A L ADRESSE : http://www.asi.fr/~ericbon/htmldoc.htm * **************************************************************************/ function runClock() { today = new Date(); hours = today.getHours(); minutes = today.getMinutes(); seconds = today.getSeconds(); timeValue = hours; timeValue += ((minutes < 10) ? ":0" : ":") + minutes; timeValue += ((seconds < 10) ? ":0" : ":") + seconds; document.clock.time.value = timeValue; timerID = setTimeout("runClock()",1000); timerRunning = true; } // --> </SCRIPT>
Le code à insérer dans l'instruction
<BODY>
:
Le code à insérer dans la partie
<BODY>
et
</BODY>
:
<form NAME="clock"> <input TYPE="text" NAME="time" SIZE=10 VALUE =""> </form>