title: Dynamically set frame src using Javascript
body: <p>I have a HTML  element</p>
  
  <pre><code>&lt;frame src="#" title="Content Frame" name="content" id="content" /&gt;
  </code></pre>
  
  <p>I want to set it's "src" dynamically using Javascript on page load. How can I do that ?</p>
  
  <p>I  am trying something like;</p>
  
  <pre><code>document.getElementById('content2').contentWindow.location = 'xyz_frame.html';
  </code></pre>
  
  <p>But for some reason it is not working..Again it is a  element and not </p>
  
  <p>A Rough code;</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script language="javascript"&gt; 
  function LoadPage(){ 
  document.getElementById('content2').src = 'ipad_lrd_frame.html';
  }
  &lt;/script&gt; 
  &lt;/head&gt;
  &lt;body onload="LoadPage()"&gt;
  &lt;frame id="content2"&gt;&lt;/frame&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>