title: document.getElementById(variable) Help!
body: <p>I know it can be done but am having issues getting it to work. Basically I want to change the font color of a specific table cell based on a variable which changes daily, in effect highlighting the day of the week in a calendar. I know that a variable can be used to get the element id but what am I missing here? I have tried using a unique DIV inside each cell but get the same error - "Object Required". Thanks in advance.
  Here is the code:</p>
  
  <pre><code>&lt;style&gt;
  </code></pre>
  
  <p>td#day1{color:white;}
  td#day2{color:white;}
  td#day3{color:white;}
  td#day4{color:white;} etc..
      </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function calculate_date(){
      currentTime = new Date();
      day = currentTime.getDate();
      return day;
      }
  function highlight_day() {
      calculate_date(); 
      today = 'day'+ day;
      document.getElementById(today).style.color= "red";
      }
  document.onload(highlight_day());
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  SEPTEMBER
  &lt;table class="cal"&gt;
  &lt;tr&gt;
  &lt;td id="day1"&gt;1&lt;/td&gt;&lt;td id="day2"&gt;2&lt;/td&gt;&lt;td id="day3"&gt;3&lt;/td&gt;&lt;td id="day4"&gt;4&lt;/td&gt;
  </code></pre>