title: PHP and Javascript getelementbyid, how to pass on parameters
body: <p>I have a <code>Javascript</code> function that is called many time within a while loop with <code>&lt;div id='c$value'&gt;</code>.
  When calling <code>countdown()</code> I would need to pass on some parameters. In this case <code>$m</code> and <code>$s</code>.</p>
  
  <p>How can this be done ?</p>
  
  <pre><code>window.onload = function() {
      &lt;?php
      $nbcounters = 5;
      for ($i = 0; $i &lt; $nbcounters; $i++) {
          echo "countdown('c$i', 0, 7);";
      }
      ?&gt;
  }
  </code></pre>
  
  <p>the php code</p>
  
  <pre><code>&lt;?php
  $value = 0;
  while ($value &lt; $nbcounters) {
      $m = rand(1, 3);
      $s = rand(10, 20);
      echo "&lt;div id='c$value'&gt;&lt;/div&gt;&lt;br&gt;";
      $value++;
   }
  ?&gt;
  </code></pre>
  
  <p>Thanks!</p>