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

Learn More

Digital Clock using Jquery | JavaScript

Forked from How to use the jQuery $().ready function.

4600 Runs 9120 Views 3764 Copies

Use this sample code to make a digital clock for your web page using on simple jquery and javascript codes.

Saved

Saved

DebarghyaSir 5

DebarghyaSir
published 3 years ago

/*  jQuery ready function. Specify a function to execute when the DOM is fully loaded.  */
$(document).ready(function() {
  var currentdate = new Date();
	var l=0;
	function callme()
	{
		currentdate = new Date();
		$('.hour').html(currentdate.getHours()+12);
		$('.min').html(currentdate.getMinutes());
		$('.second').html(currentdate.getSeconds());
		$('.data').css({'padding-left':l+'px'}); 
		l=l+5;
	}
window.setInterval(callme,1000);

});
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).