<!DOCTYPE HTML>
<html>
<head>
<title>Timer + hideDiv</title>
<meta charset="utf-8">
</head>
<body>
<script>
"use strict";
var mins = 90; //Set the number of minutes you need
var secs = mins * 60;
var currentSeconds = 0;
var currentMinutes = 0;
var tmr;
tmr = setTimeout(Decrement,1000);
function Decrement() {
currentMinutes = Math.floor(secs / 60);
currentSeconds = secs % 60;
if(currentSeconds <= 9) currentSeconds = "0" + currentSeconds;
secs--;
document.getElementById("timer_").innerHTML = currentMinutes + ":" + currentSeconds;
if(secs !== -1) { tmr = setTimeout('Decrement()',1000); }
if(mins == 0 || secs == 0) window.location.replace("http://stackoverflow.com");
}
window.onload = function() {
var myBtn = document.getElementById('stop');
myBtn.onclick = function() {
var hideDiv = document.getElementById('note');
if (myBtn.innerText == 'Stop') {
clearTimeout(tmr);
myBtn.innerText = 'Start';
hideDiv.style.display = 'block';
} else {
Decrement();
myBtn.innerText = 'Stop';
hideDiv.style.display = 'none';
}
}
}
</script>
<button id="stop">Stop</button>
<div id="timer_" style="color: #000; font-size: 150%; font-weight: bold;"></div>
<div id="note" style="display: none;" >Это скрытая информация!</div>
</body>
</html>