How to make a javascript affect all values in a table
<p>I am trying to make a "td" disappear whenever the date occured before that date today (in the past). But what is happening is that only the first column is affected while the others aren't.</p>

<pre><code> &lt;script type="text/javascript"&gt;
    //&lt;![CDATA[

    function vanish() {
    downloadUrl("bckendcommmap.php", function(data) {
    var xml = data.responseXML;
    var markers50 = xml.documentElement.getElementsByTagName("marker50");

    // Split timestamp into [ Y, M, D, h, m, s ]
    for (var i = 0; i &lt; markers50.length; i++) {
    var newdate = markers50[0].getAttribute("date");
    var trainid = markers50[0].getAttribute("trainingid");
    var t = newdate.split(/[- :]/);

    // Apply each element to the Date function
    var d = new Date(t[0], t[1]-1, t[2]);

    alert(d);
    var rightNow = new Date();
    var trainingDate = new Date(d);

    if (rightNow &lt; d ) {
    document.getElementById("assess").innerHTML = ""; /* make it disappear */
    }
    else if (rightNow &gt; d ) {
    document.getElementById("edit").innerHTML = "";
    }

    // -&gt; Wed Jun 09 2010 13:12:01 GMT+0100 (GMT Daylight Time)


    }
    });
    }

        function downloadUrl(url, callback) {
          var request = window.ActiveXObject ?
              new ActiveXObject('Microsoft.XMLHTTP') :
              new XMLHttpRequest;

          request.onreadystatechange = function() {
            if (request.readyState == 4) {
              request.onreadystatechange = doNothing;
              callback(request, request.status);
            }
          };

          request.open('GET', url, true);
          request.send(null);
        }
        function doNothing() {}
        //]]&gt;
    &lt;/script&gt;
</code></pre>

<p>Here are parts of the table and the td:</p>

<pre><code>&lt;body onload="vanish();"&gt;
&lt;table id="gradient-style" width="290" border="0" cellspacing="0" cellpadding="0" &gt;

&lt;thead&gt;
&lt;tr&gt;

&lt;td align="center"&gt;&lt;strong&gt; Training Name&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;strong&gt; Description&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;strong&gt; Location&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;strong&gt; Date&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;strong&gt; Time Start&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;strong&gt; Time End&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;strong&gt; Capacity&lt;/strong&gt;&lt;/td&gt;
&lt;td align="center" colspan="2"&gt;&lt;strong&gt;Actions&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;?php
while($rows=mysql_fetch_array($get)){
?&gt;
&lt;tbody&gt;
&lt;tr&gt;

&lt;td&gt;&lt;?php echo $rows['title']; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo $rows['description']; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo $rows['location']; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo $rows['date']; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo $rows['start']; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo $rows['end']; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo $rows['capacity']; ?&gt;&lt;/td&gt;

**&lt;td align="center"&gt;&lt;div id="edit"&gt;&lt;a href="TrainingUpdate.php?id=&lt;?php echo $rows['trainingid']; ?&gt;"&gt;Edit&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td align="center"&gt;&lt;div id="assess"&gt;&lt;a  href="Training_Assessment.php?id=&lt;?php echo $rows['trainingid']; ?&gt;"&gt;Assess Training&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;**

&lt;/tr&gt;
&lt;/tbody&gt;
&lt;?php
}
?&gt;
&lt;/table&gt;
&lt;/body&gt;
</code></pre>

<p>This line is the td that I'm trying to vanish with respect to the date:</p>

<pre><code>&lt;td align="center"&gt;&lt;div id="edit"&gt;&lt;a href="TrainingUpdate.php?id=&lt;?php echo $rows['trainingid']; ?&gt;"&gt;Edit&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td align="center"&gt;&lt;div id="assess"&gt;&lt;a  href="Training_Assessment.php?id=&lt;?php echo $rows['trainingid']; ?&gt;"&gt;Assess Training&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
</code></pre>
