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.
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 :
<input id="page_tag_add_input"></input>';
<span class="page_tag_add"><a href="#" onclick="var newTag = document.getElementById('page_tag_add_input').value; doTagXhr('add_tag.php', newTag); alert(newTag);">Add</a></span>
The doTagXhr function is a YUI connection manager AJAX call.
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 :-(
Are there any gurus out there that can point me in the right direction? Thanks.