Welcome To Paki Tigers Community


 
HomeFAQSearchMemberlistUsergroupsRegisterLog in

Share
 

 Timing Event With Stop Button

Go down 
AuthorMessage
Admin
Admin


Posts : 102
Join date : 2008-09-25
Age : 28
Location : Pakistan

Timing Event With Stop Button Empty
PostSubject: Timing Event With Stop Button   Timing Event With Stop Button Icon_minitimeSat Oct 04, 2008 6:32 am

Hello Everybody

This is another timer tutorial


<html>
<head>
<script type="text/javascript">
var c=0;
var t;
function timedCount()
{
document.getElementById('txt').value=c;
c=c+1;
t=setTimeout("timedCount()",1000);
}

function stopCount()
{
clearTimeout(t);
}
</script>
</head>

<body>
<form>
<input type="button" value="Start count!" onClick="timedCount()">
<input type="text" id="txt">
<input type="button" value="Stop count!" onClick="stopCount()">
</form>
<p>
Click on the "Start count!" button above to start the timer. The input field will count forever, starting at 0. Click on the "Stop count!" button to stop the counting.
</p>
</body>

</html>
Back to top Go down
View user profile http://paki-tigers.forumotion.com
 
Timing Event With Stop Button
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Welcome To Paki Tigers Community :: Programming / Designing / Source Code :: Html, Java Script & Css-
Jump to: