title: Getting object of anchor tag using getElementById
body: <pre><code>anchorobject = document.getElementById('backbutton');
  alert(anchorobject);
  
  &lt;a href="http://www.hotmail.com" id="backbutton"&gt;back&lt;/a&gt;
  </code></pre>
  
  <p>The above code alerts the href attribute string (<code>http://www.hotmail.com</code>). Not the object itself. The file I am editing is just a local file which I want to use in some third party program in the future. First, I am coding it on my local computer. When I try to get the object of a <code>DIV</code> it works just fine.</p>
  
  <p>Why can't I get the object of an anchor (<code>&lt;a&gt;</code>) tag in JavaScript using <code>document.getElementById()</code>?</p>