getElementByID().parentNode is returning null
<p>For some reason, this is happening very vaguely. Its working sometimes and sometimes it is not. The same line of code, for the different "myid" under same parent, the line -</p>

<p><code>document.getElementById("myid").parentNode</code> is returning null.</p>

<p>I am quite sure that element "myid" is not a root element and its parent is a DIV which needs to be returned. I am using Firefox 3.6.10 version.</p>

<p>Can anyone suggest any reason why this could be happening?</p>

<p>EDIT: The "myid" here is some kind of a textbox or any other control element. But the parentnode is always DIV. Any controls we add are always wrapped under a DIV. So basically when something on the screen refreshes, we get the parent node and replace the innerhtml. The innerhtml could be anything.</p>

<p>given below is the html I have -</p>

<pre><code>&lt;div style="height: 334px; width: 769px; position: relative;"&gt;

    &lt;span style="display: inline-block; height: 13px; width: 61px; position: absolute; left: 393px; top: 84px;" bizappid="System856UserGroupAppPoint156d5elabel300" tabindex="-1" id="System856UserGroupAppPoint156d5elabel300"&gt;User Group&lt;/span&gt;   

    &lt;input type="text" style="height: 20px; width: 221px; position: absolute; left: 503px; top: 77px;" bizappid="System856UserGroupAppPoint156d5etextBox190" class="formtextbox" tabindex="400" id="System856UserGroupAppPoint156d5etextBox190" readonly="readonly" name="System856UserGroupAppPoint156d5etextBox190"&gt;
&lt;/div&gt;
</code></pre>

<p>In this Html, assume I am getting ParentNode for Span element, but I am not getting the same parentNode for the Input text element. Also one more strange thing is, I just added a check saying if getelementbyid is not null, then check its parentNode. Then further added if parentNode is not null then do refresh operation. Now the control is not coming inside the parentNode not null condition.</p>
