title: Getting getElementById is Undefined
body: <p>Here's my code: </p>
  
  <pre><code>&lt;html&gt;
  &lt;header&gt;
  &lt;title&gt;Checkup Date&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
  function datechange() {
  if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();  }
  else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject
  
  ("Microsoft.XMLHTTP");
  
    }
  
  var tr = getElementsById(nameUpdate)
  var tds = tr.getElementsByTagName('td');
  var user = "";
  var date = "";
  for(var i = 0, len = tds.length; i &lt; len; ++i) {
      user = tds[0];
      date = tds[3];
  }
  
  
  var url = "changedate.psp"
  var params = "user=" + user + "&amp;date=" + date;
  
  xmlhttp.open("GET", url + "?" + params, true);
  xmlhttp.send();
  xmlDoc=xmlhttp.responseXML;
  
  }
  
  &lt;/script&gt;
  &lt;/header&gt;
  
  &lt;body&gt;
  
  &lt;%
  Python that doesn't matter
  %&gt;
  
  &lt;%= More Python %&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My outputted HTML:</p>
  
  <pre><code>&lt;tr id="TL-D03"&gt;
  &lt;td&gt;nobody&lt;/td&gt;
  &lt;td&gt;TL-D03&lt;/td&gt;
  &lt;td&gt;2010-01-01&lt;/td&gt;
  &lt;td&gt;
  &lt;input type="checkbox" onclick="var nameUpdate = 'TL-D03'; datechange();"&gt;
  </code></pre>
  
  <p><strong>What am I doing wrong here? It says getElementById is undefined.</strong></p>