1
How do I change the function below? I want to display the time in a div.
<HTML>
<HEAD>
<TITLE>cronometro</TITLE>
<script language="JavaScript">
<!--
function showtime()
{ setTimeout("showtime();",1000);
callerdate.setTime(callerdate.getTime()+1000);
var hh = String(callerdate.getHours());
var mm = String(callerdate.getMinutes());
var ss = String(callerdate.getSeconds());
document.clock.face.value =
((hh < 10) ? " " : "") + hh +
((mm < 10) ? ":0" : ":") + mm +
((ss < 10) ? ":0" : ":") + ss;
}
callerdate = new Date(<?php
date_default_timezone_set('America/sao_paulo');
$brasil = date('Y,m,d,H,i,s', time());
echo $brasil;
?>);
//-->
</script>
</HEAD>
<meta name="" content="">
<body onLoad="showtime()">
<form name="clock"><input name="face" value=""></input>
</form>
</body>
</HTML>
But what’s wrong, the function or just not being able to display the time in a div? Your html is all wrong tbm, has two body tags and the input tag has no closing tag.
– LeAndrade
Good morning Leandrade, despite the bugs that have already been fixed is all working normal, I just want to remove the form and input to put the information in a div.
– Xiro Nakamura
But then it is not only delete the form and the input and in place insert the div and the same way that called the function in the tag body, call in the created div?
– LeAndrade
but I need to pass values to div(name="clock", name="face", value=" ") as I do?
– Xiro Nakamura