title: one js function call in multiple elements, jsp
body: <p>I have a table with many rows. In each row I have to show a countdown timer with given value.</p>
  
  <p>This is my js function in jsp.</p>
  
  <pre><code>&lt;script&gt;
  function start(initial_time) {
      var initialTime = initial_time.value;
  
          tick();
          setInterval(function () {
              tick();
              if (initialTime &lt; -1) reset();
              if (initialTime &lt; 6) paint("red")
          }, 1000)
  
      function tick() {
          document.getElementById("time").innerHTML = initialTime.toString();
          --initialTime;
      }
  
      function reset() {
          initialTime = 30;
          tick();
          paint("black");
      }
  
      function paint(color) {
          document.getElementById("time").style.color = color;
      }
  }
  </code></pre>
  
  <p></p>
  
  <p>This is my table row in the same jsp page</p>
  
  <pre><code>&lt;table style="width: 100%; height: 100%; table-layout: fixed;" align="center"&gt;
  &lt;tbody &gt;
  &lt;c:forEach items="${data.getCards()}" var="card"&gt;
      &lt;tr&gt;
          &lt;td style="table-layout: fixed; vertical-align: middle; font-size: 30px; text-align: left; width: 100%; background-color: #78909C;"
              colspan="4"&gt;${card.getLocationName()}&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style="vertical-align: middle; font-size: 24px; text-align: left; width: 70%; background-color: #b0bec5;"
              colspan="3"&gt;Time left for next density check
          &lt;/td&gt;
          &lt;td style="vertical-align: middle; font-size: 22px; text-align: left; width: 30%; background-color: #b0bec5;" colspan="1"&gt;
              &lt;div id="time" onload="start(${card.getDefaultServerDensityValue()})"&gt;&lt;/div&gt;                &lt;input hidden="hidden" id="density" value="${card.getDefaultServerDensityValue()}"/&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>Seems ok but timers in rows does'n shown up, does anybody knows why?</p>