Uncaught Error: NOT_FOUND_ERR: DOM Exception 8 for appendChild call
<p>The error occurs on the last line of this snippet:</p>

<pre><code> var anchor = "&lt;a id=\"hostname\" href=\"" + destination + "\"&gt; "+ imagename + "&lt;/a&gt;";
 var specialdiv = document.getElementById("specialdiv");
 console.log("div: " + specialdiv);
 specialdiv.appendChild(anchor);
</code></pre>

<p>There's really nothing else going on... I verified that <code>specialdiv</code> isn't null or something like that. Can anyone explain why I'm getting this error on that line?</p>
