Jquery Timer Example - Jquery
How to create a simple timer using jquery?
Snippet Code
Jquery timer plugin used to display the simple timer according to your delay time. Here, the simple jquery timer code is given below.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src='https://raw.githubusercontent.com/jchavannes/jquery-timer/master/jquery.timer.js'></script>
<script>
$(document).ready(function () {
var count = 0;
var timer = $.timer(function() {
$('#counter').html(++count);
});
timer.set({ time : 1000, autostart : true });
});
</script>
<b>Timer starts :</b> <span id='counter'></span>
Tags