user999,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function() {
var starttime;
var timer;
timer2();
function timer2() {
starttime = '3:15';
starttime = starttime.split(':');
var startmin = Number(starttime[0]);
var startsec = Number(starttime[1]);
var min = startmin;
var sec = startsec;
timer = setInterval(function(){
$('.time').html(min+":"+sec);
sec--;
if(sec < 0 && min > 0) {
min = min-1;
sec = 59;
}
if (min == 0 && sec < 0) {
clearInterval(timer);
}
},1000);
}
$('.reboot').on('click', function() {
clearInterval(timer);
timer2();
});
});
</script>
<div class="time"></div>
<input type="button" class="reboot" value="Обновить"/>
</body>
</html>