<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="class.css" rel="stylesheet" type="text/css"> <script language="JavaScript"> var timerID = null; var timerRunning = false; function startclock () { stopclock(); time(); } function stopclock () { if(timerRunning) clearTimeout(timerID); timerRunning = false; } function time() { var now = new Date(); var ampm = (now.getHours() >= 12) ? " P.M." : " A.M." var hours = now.getHours(); hours = ((hours > 12) ? hours - 12 : hours); var minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes(); var seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds(); var Time=(hours + minutes + seconds + " " + ampm ); window.status=Time; timerID = setTimeout("time()",1000); timerRunning = true; } function clearStatus() { if(timerRunning) clearTimeout(timerID); timerRunning = false; window.status=""; } </script> <head> </head> <body onLoad="startclock()"> <h1><marquee>Teste do Relagio</marquee></h1> </body> </html>