title: How to get elements from nested <html> document?
body: <pre><code>&lt;html&gt;&lt;head&gt;
  &lt;title&gt;Welcome&lt;/title&gt;
  &lt;style type="text/css"&gt;&lt;/style&gt;&lt;/head&gt;
      &lt;frameset border="false" frameborder="O" framespacing="0" rows="0,*" cols="*"&gt;
          &lt;frame marginwidth="0" marginheight="0" name="frame_rsafp" src="rsa_flash_cookie.html" noresize="true" scrolling="no"&gt;
          &lt;frameset border="false" frameborder="O" framespacing="0" rows="*,30" cols="*"&gt;
              &lt;frame marginwidth="0" marginheight="0" name="login_page" noresize="true" scrolling="yes"&gt;
                             #document
                               &lt;html&gt;
                                 &lt;form name="frmLogin" action="entry" class="login" method="post" target="_top" autocomplete="off"&gt;
                                     &lt;span class="passfield"&gt;
                                         &lt;input type="text" name="LoginUserId" onkeypress="return fSubmit(event);" value="" class="ipassword"&gt;
                                     &lt;/span&gt;
                                 &lt;/form&gt;
                               &lt;/html&gt;                             
              &lt;frame marginwidth="0" marginheight="0" name="footer" src="footer.html" noresize="true" scrolling="no"&gt;
          &lt;/frameset&gt;
      &lt;/frameset&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>For above html code I want to set value to text field "<strong>LoginUserId</strong>".
  I tried 
  <code>document.getElementsByName("LoginUserId")[0].value = "MyValue";</code>
  but it returns the error <strong>Cannot set property 'value' of undefined</strong>.
  I can only get elements upto "<strong>login_page</strong>" and count of child elements of "<strong>login_page</strong>" returns <strong>0</strong>.</p>
  
  <pre><code>var ele = document.getElementsByName("login_page")[0].childNodes;
  alert(ele.length);
  </code></pre>
  
  <p>How can I get elements of this nested html document?</p>