Display Digital Clock In Browsers Using JavaScript
<!DOCTYPE html>
<html>
<body>
<p>The Time is :</p>
<p id="display"></p>
<script>
var myVar = setInterval(myTimer, 1000);
function myTimer() {
var d = new Date();
document.getElementById("display" ).innerHTML = d.toLocaleTimeString();
}
</script>
</body>
</html>
No comments:
Post a Comment