title: JavaScript unintentionally "translates" DOM element id string into DOM object reference?
body: <p>Lets assume I have this code:</p>
  
  <pre><code>function foo (id_of_dom_element, number){
  
      document.getElementById(id_of_dom_element).innerHTML=number;
      number = number + 1;
      setTimeout("foo(" + id_of_dom_element + "," + number + ")", 1000);
  }
  </code></pre>
  
  <p>Initial call to the function:</p>
  
  <pre><code>foo("countdown", 0);
  </code></pre>
  
  <p>What happens:</p>
  
  <ul>
  <li>At first iteration, everything works like it should </li>
  <li>At second iteration however, "id_of_dom_element" is no longer a string but a DOM object reference??</li>
  </ul>
  
  <p>Questions:</p>
  
  <ul>
  <li>Why is this happening (I don't even know how to search for this phenomenon)?</li>
  <li>How can I prevent that?</li>
  </ul>
  
  <p>Thank you very much!</p>