Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One way to load Iframe content when the page loads is by setting the "src" attribute of the Iframe element to the URL of the content that you want to load. For example, if the Iframe is located in the HTML code like this:

<iframe id="myIframe"></iframe>

Then you can use JavaScript to set the "src" attribute to the URL of the content:

var iframe = document.getElementById("myIframe");
iframe.src = "http://www.example.com/content.html";

This code should be placed in a script tag in the head or body section of the HTML code. When the page loads, the Iframe will automatically load the content specified in the "src" attribute.