I need to use <meta http-equiv="REFRESH">
to display the current time as it changes.
This is what i tried:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="refresh" content="1">
<script type="text/javascript">
function change_time()
{
var d = new Date();
var curr_hour = d.getHours();
var curr_min = d.getMinutes();
var curr_sec = d.getSeconds();
if(curr_hour > 12)
curr_hour = curr_hour - 12;
document.getElementById('time').innerHTML = curr_hour+':'+curr_min+':'+curr_sec;
}
change_time();
</script>
</head>
<body>
<table>
<tr>
<td>Current time is :</td>
<td id="time"></td>
<tr>
</table>
</body>
</html>
The page refreshes itself every second but it doesn't not show the functions value.