тоже фигней помаялся )
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<select id="hr"></select> :
<select id="mn"></select>
<button>Установить таймер</button>
<p id="p"></p>
<script>
var hour = '';
var minutes = '';
for (var i = 0; i < 24; ++i) {
hour += '<option value = "' + i + '">' + (i < 10 ? '0' + i : i) + '</option>\n';
}
for (var i = 0; i < 60; ++i) {
minutes += '<option value = "' + i + '">' + (i < 10 ? '0' + i : i) + '</option>\n';
}
hr.innerHTML = hour;
mn.innerHTML = minutes;
function timer() {
var time = new Date();
if (time.getHours() == hr.selectedIndex
&&
time.getMinutes() == mn.selectedIndex) {
var beep = new Audio('http://delaytesami.com/ramshtajn.mp3');
beep.play();
} else {
p.innerHTML = 'Осталось:<br> часов: ' + (hr.selectedIndex - time.getHours()) +
', минут: ' + (mn.selectedIndex - time.getMinutes());
setTimeout(timer, 1000);
}
}
document.querySelector('button').onclick = timer;
</script>
</body>
</html>