title: JavaScript Element.length returns invalid length in Visulaforce
body: <p>JavaScript <strong>Element.length</strong> returns invalid length while executing in Visualforce page.</p>
  
  <p>I'm expecting body NodeList length to be <strong>14</strong>. But after printing <code>console.log('allDocElements length:: ',allDocElements.childNodes.length);</code>
  It return <strong>10</strong>. how this is possible?</p>
  
  <p>I'm executing it in Google Chrome.</p>
  
  <p><a href="https://i.stack.imgur.com/ZVl6k.png" rel="nofollow noreferrer">View console output</a></p>
  
  <pre><code>&lt;apex:page showHeader="false" sidebar="false"&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;JS Addignment 1&lt;/title&gt;
          &lt;style&gt;
              body {
                  text-align:center;
                  font-size:30px;
              }
              .center {
                  width:70%; 
                  margin:15% auto;
                  border-collapse:collapse;
                  border:2px solid #000000;
              }
              table td {
                  border:2px solid #000000;
              }
          &lt;/style&gt;
          &lt;script&gt;
          let dateContainer, dayContainer, timeContainer;
          let allDocElements = document.getElementsByTagName('body')[0];            
  
          console.log('allDocElements::',allDocElements.childNodes);
  
  
  
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;table border="1" style="" class="center" cellpadding="20"&gt;
              &lt;tbody&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;label&gt;Date: &lt;/label&gt;&lt;span id="dateContainer"/&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;label&gt;Day: &lt;/label&gt;&lt;span id="dayContainer"/&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td colspan="2"&gt;&lt;span id="timeContainer"/&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p></p>