avatar
Untitled

Guest 45 15th May, 2019

MARKUP 1.84 KB
                                           
                         <!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>ddddddddddddd</title>
</head>
<body>
	<form action="" name="f">
		<div class="box">
			<center>
				<div class="clock">
					<input type="" name="time" value="01:30" id="timeClock">
				</div>
				<input type="button" class="button" onclick="Start()" value="START">
				<input type="button" class="button" onclick="Stop()" value="STOP">
				<input type="button" class="button" onclick="Reset()" value="RESET">
			</center>
		</div>
	</form>
</body>
<script>

	var timeOut;
	var timeBegin;
	function Start() 
	{
		var second=parseInt(f.time.value.substr(3,4));
		var minutes=parseInt(f.time.value.substr(0,2));
		if (timeBegin==null)
			timeBegin=f.time.value;

		if (second!=0) 
			second--;
		else
		{
			minutes--;
			second=59;
		}
		if (second<10) 
		{
			if (minutes<10)
				f.time.value="0"+minutes+":0"+second;
			else
				f.time.value=minutes+":0"+second;
			
		}
		else{
			if (minutes<10) 
				f.time.value="0"+minutes+":"+second;
			else
			{
				f.time.value=minutes+":"+second;
			}
		}
		if (f.time.value=="00:00")
		{
			alert("Het gio")
			f.time.value="00:00";
		}
		else
			timeOut=setTimeout(Start,1000);
	}

	function Stop()
	{
		clearTimeout(timeOut);
	}

	function Reset()
	{
		f.time.value=timeBegin;
		Stop();
	}
</script>
</html>
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes