title: Javascript variable is assigned as [object HTMLDivElement] rather than string?
body: <p>My DOM skills are weak and I can't work out why a javascript variable is assigned this object pointer value rather than the string value itself. </p>
  
  <p>Short story is that I am making an AJAX call for some screen data and it returns html and populates a div.innerHTML with the following : </p>
  
  <pre><code> &lt;input id="page_tag_add_input"&gt;&lt;/input&gt;';
  
      &lt;span class="page_tag_add"&gt;&lt;a href="#" onclick="var newTag = document.getElementById('page_tag_add_input').value; doTagXhr('add_tag.php', newTag); alert(newTag);"&gt;Add&lt;/a&gt;&lt;/span&gt;
  </code></pre>
  
  <p>The doTagXhr function is a YUI connection manager AJAX call.</p>
  
  <p>When the user clicks add, firebug shows me that the newTag variable is stored as "[object HTMLDivElement]", yet when the alert(newTag) javascript kicks in (above), it shows the value correctly as the input text string?? I've exhausted Google searches :-( </p>
  
  <p>Are there any gurus out there that can point me in the right direction? Thanks. </p>