title: Apply javascript function to every row of a table using the cell value as a parameter?
body: <p>I have a table (generated from a php array) that shows a users current auctions. One of the columns of this table shows the time remaining in the auction. I am using a jquery countdown plugin (<a href="http://www.keith-wood.name/countdown.html" rel="nofollow">http://www.keith-wood.name/countdown.html</a>) that makes the remaining time countdown to zero.</p>
  
  <p>How can I apply the countdown function to every row using the different remaining times?</p>
  
  <pre><code>$(function () {
      $('#countdown').countdown({until: +remainingTime, format: 'HMS', compact: true});
  });
  </code></pre>
  
  <p>what I am trying, but doesn't seem to be working:</p>
  
  <pre><code> foreach($tradePile['auctionInfo'] as $auction)
   {                      
       if ($auction['tradeState'] == "active")
       {
          $i++;
          echo '&lt;tr&gt;';
          echo '&lt;td&gt;&lt;a href="player.php?id='.$auction['itemData']['resourceId']. '"&gt;'.$stats['first_name'].' '.$stats['last_name'].'&lt;/a&gt;&lt;/td&gt;';
          echo'&lt;td&gt;'.$auction['itemData']['rating'].'&lt;/td&gt;';
          echo'&lt;td&gt;'.$buyNowPrice.'&lt;/td&gt;';
          echo'&lt;td&gt;'.$auction['startingBid'].'&lt;/td&gt;'; 
          //remaining time for each auction:
          //$auction['expires']
          ?&gt;
          &lt;td&gt;
             &lt;script&gt;$(function () {$('#countdown&lt;?php echo $i; ?&gt;').countdown({until: +&lt;?php echo $auction['expires'] ?&gt;, format: 'HMS', compact: true});});&lt;/script&gt;
             &lt;div id="countdown&lt;?php echo $i; ?&gt;"&gt;&lt;/div&gt;
          &lt;/td&gt;
          &lt;?php
          echo'&lt;/tr&gt;';
       }
  }
  </code></pre>