Automatically Increase The Text value by the help of Javascript

K011gusain89
Posted by K011gusain89 under JavaScript category on | Points: 40 | Views : 1545
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"> <title></title>
<script type="text/javascript">
var c = 0;
var t;
var timer_is_on = 0;

function timedCount()
{
document.getElementById('txt').value = c;
c = c + 1;
t = setTimeout("timedCount()", 1000);
}

</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" value="Start count!" onClick="timedCount()">
<input type="text" id="txt">
</form>
</body>
</html>

Comments or Responses

Login to post response