!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
var sec = 0;
var interval;
function pad(val) {
return val > 9 ? val : "0" + val;
}
function showTime() {
document.getElementById("seconds").innerHTML= diff > 0 ? Math.floor(diff / 1000) % 60 : 0;
document.getElementById("minutes").innerHTML= diff > 0 ? Math.floor(diff / 1000 / 60) % 60 : 0;
}
function start() {
interval = setInterval( function() {
showTime();
}, 1000);
};
$(".button").on('click', function() {
start();
});
</script>
</head>
<body>
<div id = "main">
<button class="button">Закомпостировать</button>
<span id="minutes">59</span>:<span id="seconds">60</span>
</div>
</body>
</html>