Copy code code as follows:
<html>
<head>
<script language = "javascript" type = "text/javascript">
function showtime () {
// The text between elements is through the object .innertext
document.GetelementByid ("MyTime"). Innertext = new date (). TOLOCALESTRING ();
}
Setinterval ("showtime ()", 1000);
</script>
</head>
<body>
<span id = "mytime"> </span>
</body>
</html>