Why can't I appendChild to the specified DIV?
<p>In some cases it is possible for me to use appendChild() to add to a div, but in other cases it does not work and I am trying to understand why:</p>

<p><strong>Works:</strong> I have other code examples where something like the following code works fine:</p>

<pre><code>function fnAppend(){
   var oNewNode = document.createElement("LI");
   oList.appendChild(oNewNode);
   oNewNode.innerText="List node 5";
}
</code></pre>

<p><strong>Does not Work:</strong> I know this is a totally different example, but I presume the difference is subtle. I am pulling this code from an existing project I am working in, so I can not change the <strong>FieldSet function</strong> in anyway, rather I am trying to understand how to make it work. </p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;script type="text/javascript"&gt;     
        function Fieldset() {

            this.id = "";
            this.content = document.createElement("DIV");
            this.content.id = "content";
            this.title = "Title";

            this.getFieldset = function() {
                var div = document.createElement("DIV");
                div.id = this.id;
                var span = document.createElement("SPAN");
                //var fieldset = document.createElement("DIV");
                //fieldset.id = "fieldset";
                var header = document.createElement("DIV");
                header.id = "header";
                span.appendChild(document.createTextNode(this.title));
                header.appendChild(span);
                div.appendChild(header);
                div.appendChild(this.content);
                //div.appendChild(fieldset);

                return div;
            }
        }

        var fieldset = new Fieldset();
        fieldset.id = "newid";
        fieldset.title = "new title";

        org_div1.appendChild(fieldset.getFieldset());

        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body onload="fieldset()"&gt;
        &lt;div id='org_div1'&gt; The text above has been created dynamically.&lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
