Shouldn't getElementById return an object containing sub objects?
<p>Using the following code I was expecting to get an object which contains the sub elements</p>

<pre><code>var MemberDiv=document.getElementById("idProfileMainContainer");
console.log(MemberDiv.length);
</code></pre>

<p>Using the above code I get "undefined". I'm confused. I thought it should have an object array that contains all sub elements.</p>

<p>Ultimately I am trying to find the sub <code>&lt;div /&gt;</code> with the <code>&lt;span /&gt;</code> that has "Board Position" in it.</p>

<pre><code>&lt;div id="idContainer8592665" class="fieldContainer simpleTextContainer"&gt;
    &lt;div class="fieldSubContainer labeledTextContainer"&gt;

        &lt;div class="fieldLabel"&gt;
            &lt;span id="FunctionalBlock1_ctl00_ctl00_MemberForm_memberFormRepeater_ctl22_titleLabel" title="Cannot be edited, Administrator access only"&gt;Board Position&lt;/span&gt;
        &lt;/div&gt;

        &lt;div class="fieldBody"&gt;
            &lt;span id="FunctionalBlock1_ctl00_ctl00_MemberForm_memberFormRepeater_ctl22_DropDownLabel8592665"&gt;Webmaster&lt;/span&gt;&lt;input name="FunctionalBlock1$ctl00$ctl00$MemberForm$memberFormRepeater$ctl22$ctl03" type="hidden"&gt;
        &lt;/div&gt;

    &lt;/div&gt;
&lt;/div&gt;
</code></pre>