使用带 IFrame 的锚点

通常,使用 Iframe 启动 Iframe 中的网页更改,例如,单击 Ifame 中的链接。但是,可以从 IFrame 外部更改 IFrame 的内容。你可以使用一个锚标签,其 href 属性设置为所需的 URL,其 target 属性设置为 iframe 的 name 属性。

<iframe src="webpage.html" name="myIframe"></iframe>
<a href="different_webpage.html" target="myIframe">Change the Iframe content to different_webpage.html</a>