Difference between revisions of "JavaScript: Exemplo de uso do setInterval"

From AdonaiMedrado.Pro.Br
Jump to: navigation, search
(New page: <code lang="javascript"> <html> <head> <title>Minha Página</title> </head> <body> <input type="text" id="txtMeuContador" /> <script language="javascript"> var i ...)
(No difference)

Revision as of 23:17, 12 September 2008

<html>
  <head>
    <title>Minha Página</title>
  </head>  
  <body>
    <input type="text" id="txtMeuContador" />
    <script language="javascript">
      var i = 0;
      function f()
      {
	document.getElementById("txtMeuContador").value = i++;
      }
      setInterval(f, 500);
    </script>
  </body>
</html>