<!-- 時計を作る -->
<html lang="ja">

<head>
	<meta charset="utf-8">
	<title>時計</title>
	<style>
		body {
			background-color: #000;
		}

		#clock {
			color: #fff;
			font-size: 100px;
			font-family: 'Orbitron', sans-serif;
			text-align: center;
			margin: 0 auto;
			padding-top: 100px;
		}
	</style>
</head>

<body>
	<div id="clock"></div>
	<script>
		function showClock2() {
			var nowTime = new Date();
			var nowHour = nowTime.getHours();
			var nowMin = nowTime.getMinutes();
			var nowSec = nowTime.getSeconds();
			var msg = nowHour + ':' + nowMin + ':' + nowSec;
			document.getElementById("clock").innerHTML = msg;
		}
		setInterval('showClock2()', 1000);
	</script>
</body>

</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.