Prev Demo
JavaScript
>
Timer
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <script> var count = 0; function TestFunction() { count++; document.getElementById("lblText").innerHTML = count; t = setTimeout("TestFunction()", 1000); } </script> <label id="lblText">0</label> <input type="button" id="btnTest" onclick="TestFunction()" value="Click me" /> </body> </html>
Note: We DO NOT save your trial code in our database.
Output