Speed up development with full-stack environments for every branch.

Learn More

How to Make a Digital Clock with jQuery & CSS3 [time and moment.js]

3017 Runs 6371 Views 2375 Copies


dipesh.parmar 55

published 4 years ago

<!DOCTYPE html>

		<meta charset="utf-8"/>
		<title>How to Make a Digital Clock with jQuery &amp; CSS3</title>

		<!-- The main CSS file -->
		<link href="css/style.css" rel="stylesheet" />

		<!--[if lt IE 9]>
			<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

			The clock doesn’t need a lot of HTML.
			This is because a large part of it,
			like the names of the weekdays and the code for the digits,
			is generated dynamically.
			Here is the markup that 
			you need to have on your page to use the clock:
		<div id="clock" class="light">
			<div class="display">
				<div class="weekdays"></div>
				<div class="ampm"></div>
				<div class="alarm"></div>
				<div class="digits"></div>

		<!-- JavaScript Includes -->
		<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
		<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.0.0/moment.min.js"></script>
		<script src="js/script.js"></script>

Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).