Alarm project


#1

Hi there, i have two button here first one is working for an alarm (the sound file is on my pc)
please can u find out why the second button is not working here:(can`t use it to stop the alarm)


Timer
stop

<script>
	var the_timer;
			 	
            function sound(){
		var audio = new Audio("alarm/alarm.mp3");
		audio.play();
	};

	function timer(){
		var answer = prompt("set the waiting time in seconds please");
		var period = answer*1000;
		the_timer = setTimeout(sound,period);
	};

	function stop(){
		clearTimeout(the_timer);
	};

</script>


#2

Hey Reefoo,

Would you mind posting all of your HTML code?