![]() |
![]() |
|
![]() |
![]() |
|
Programmierung Rat & Tat für Programmierer |
|
Themen-Optionen | Ansicht |
![]() |
#6 |
Veteran
|
![]() <html>
<head> <script language="javascript" type="text/javascript"> function automatikdatum(){ var timerDiv = document.getElementById("geszeit"); var uhrstund = new Date(); var ausgabeuhrstund = uhrstund.getHours(); var uhrmin = new Date(); var ausgabeuhrmin = uhrmin.getMinutes(); var uhrsek = new Date(); var ausgabeuhrsek = uhrsek.getSeconds(); var gesamtzeit = "Current Time: " + ausgabeuhrstund + ":" + ausgabeuhrmin + ":" + ausgabeuhrsek; // alle childNodes löschen if(timerDiv && timerDiv.childNodes){ for(var i=0; i<timerDiv.childNodes.length ; i++){ timerDiv.removeChild(timerDiv.childNodes[i]); } } var timeToShow = document.createTextNode(gesamtzeit); timerDiv.appendChild(timeToShow); //wiederholung(); } function startTimer(){ window.setInterval("automatikdatum()",1000); } </script> </head> <body onload="startTimer();"> <div id="geszeit"></div> </body> </html> |
![]() |
![]() |
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1) | |
|
|