Javascript 在Iframe内部搜索特定标记并创建另一个Iframe

Javascript 在Iframe内部搜索特定标记并创建另一个Iframe,javascript,html,forms,iframe,Javascript,Html,Forms,Iframe,我有以下代码: <FORM target="frame" onsubmit="document.getElementById('frame').style.display = 'block';" method="post" action="http://www.example.com/index.html"> <input type="text" autocomplete="off" value="" name="search-field" id="header-search-

我有以下代码:

<FORM target="frame" onsubmit="document.getElementById('frame').style.display = 'block';" method="post" action="http://www.example.com/index.html">
<input type="text" autocomplete="off" value="" name="search-field" id="header-search-field">
<button type="submit">Search</button></FORM>

<iframe width="700" height="700" id="frame" name="frame" style="display: none;"></iframe>

搜索
Iframe在提交表单时正确显示。现在我必须创建第二个iframe,它在之前加载的内容中搜索特定的标记,并仅在找到时显示。 我必须搜索特定的标签:

<table id="item_specification" cellspacing="0" cellpadding="0"> with all the content inside </table>
中包含所有内容

并仅显示表ID内的内容(也有表)

如果您未违反跨源策略,则可以通过以下方式访问iframe文档:


document.getElementById('header-search-field')。contentDocument

您能解释一下吗?Iframe和form位于不同的域中。