title: document.getElementById() VS. getElementById()
body: <p>It is common for me to register javascript functions for certain events by doing something like:</p>
  
  <pre><code>myBtn.Attributes.Add("onClick", "Validate(getElementById('"+txtFirstName.ClientID + "'));");
  </code></pre>
  
  <p>I've always used <code>getElementById</code> by itself, or in other words, sans document being prepended to it. But I'm having pages break on me lately when I try to use <code>getElementById</code> instead of <code>document.getElementById</code>. Why is this? Oddly, I have a website where one page allows me to use just <code>getElementById</code>, but another other page throws a javascript error because it can't find the element if I do just <code>getElementById</code>, and it'll only work if I do <code>document.getElementById</code>. </p>
  
  <p>Anyone know why this is? Should I be using <code>document.getElementById</code> everywhere, regardless of whether it works without the document prefix?</p>
  
  <p>EDIT:
  Could it have anything to do with the fact that one page is using AJAX and the other isn't?</p>