Does document.getElementById() consider temporarily created DIV
<p>I have a DIV like this  </p>

<pre><code> var div = document.createElement('div');
 div.innerHTML = "&lt;div id='a'&gt;&lt;/div&gt;";  
</code></pre>

<p>And I have not appended it to document yet.. But I just want to retrieve the element <code>a</code> from temporary DIV.. </p>

<p>I have this way otherwise  </p>

<pre><code> div.style.display = "none";
 document.body.appendChild(div);
 // then
 var a = document.getElementById('a');
</code></pre>

<p>Is there any other better solution for this..?</p>
