GetElementById Returning Null In IE
<p>In the function below chld is null only in IE, in firefox the javascript works fine.</p>

<pre><code>    var div = document.createElement("div");

    var divid = "dv" + num;

    div.setAttribute("ID", divid);

    div.setAttribute("value", num);



    var _text = document.createElement("input");

    _text.setAttribute("type", "text");

    _text.setAttribute("id", "txtAsName" + num);



    _text.setAttribute("name", "txtAsName" + num);


    var lbl = document.createElement("label");




    var _upload = document.createElement("input");

    _upload.setAttribute("type", "file");

    _upload.setAttribute("ID", "upload" + num);



    _upload.setAttribute("name", "uploads" + num);

    _upload.setAttribute("size", "80");



    var hyp = document.createElement("a");

    //hyp.setAttribute("style", "cursor:Pointer");
    hyp.style.cssText='cursor:Pointer';

    //hyp.setAttribute("onclick", "return RemoveDv('" + divid + "');");
    hyp.onclick=function() {RemoveDv(divid);};

    hyp.innerHTML = "Remove";



    var br = document.createElement("br");

    var _pdiv = document.getElementById("Parent");

    div.appendChild(br);

    div.appendChild(lbl);

    div.innerHTML += ' ';

    div.appendChild(_text);

    div.innerHTML += ' ';

    div.appendChild(_upload);

    div.innerHTML += ' ';

    div.appendChild(hyp);

    _pdiv.appendChild(div);
</code></pre>

<p>....</p>

<p>Here is the remove function</p>

<pre><code> function RemoveDv(obj) {

        var p = document.getElementById("Parent");

        var chld = document.getElementById(obj);


        p.removeChild(chld);

    }
</code></pre>

<p>Here is what the div tags look lie that I am trying to remove..</p>

<pre><code>&lt;div align="left" id="Parent"&gt;
    &lt;div ID="dv1" value="1"&gt;
&lt;div ID="dv2" value="2"&gt;
</code></pre>

<p>....</p>

<p>Interestingly even when I add this line of code "for debug sake" chld1 is still null</p>

<pre><code>var chld1 = document.getElementById("dv1");
</code></pre>

<p>UPDATE:</p>

<p>It seems that there is nothing wrong with the code itself. If I run the same code in ie off my local code chld gets set. But if I run this code off our dev server ie does not see the element.</p>

<p>Any ideas why this could be?</p>
