title: javascript using settimeout() with a loop
body: <p>ive got a table with 8x10 cells.. each sell got an input element with its own id (11, 12, ... , 21,22,23,...)
  now i want to fill these inputs after and after (lets say 0.5 sec)
  i just entered some values for testing</p>
  
  <pre><code>        Betrag = new Array();
          Betrag[0] = new Array();
          Betrag[1] = new Array("asd","asd","asd","asd","asd","asd","asd","asd","asd","asd","513.000,00");
          Betrag[2] = new Array("asd","adsd","asd","asd","asd","asd","asd","asd","asd","asd","asd");
          Betrag[3] = new Array("asd","asd","asd","asd","asd","asd","asd","asd","asd","asd","asd");
          Betrag[4] = new Array("asd","uisgui","asd","asd","asd","asd","asd","asd","asd","asd","asd");
          Betrag[5] = new Array("asd","asd","asd","asd","asd","asd","asd","asd","asd","asd","asd");
          Betrag[6] = new Array("asd","asd","asd","asd","asd","asd","asd","asd","asd","asd","asd");
          Betrag[7] = new Array("asd","asd","asd","asd","asd","asd","asd","asd","asd","asd","asd");
          Betrag[8] = new Array("asd","asd","asd","asd","asd","asd","asd","asd","asd","asd","asd");
  
            for(i=1; i&lt;=8; i++){
              for(k=1; k&lt;=10; k++){
                setTimeout(function schreiben(){document.getElementById(''+i+k+'').value= Betrag[i][k];}, 1000);
                //document.getElementById(''+i+k+'').value= Betrag[i][k];
              }
            }
  </code></pre>
  
  <p>the compiler says "TypeError: Cannot read property '11' of undefined"</p>
  
  <p>if i would not use the settimeout() function the whole loop is working fine, but with this function ive got this mistake..</p>