用jQuery在IFRAME里取得父窗口的某个元素的值

<p>用jQuery在IFRAME里取得父窗口的某个元素的值</p> <p>只好用DOM方法与jquery方法结合的方式实现了</p> <p>1.在父窗口中操作 选中IFRAME中的所有单选钮<br /> $(window.frames[&quot;iframe1&quot;].document).find(&quot;input[@type=&#39;radio&#39;]&quot;).attr(&quot;checked&quot;,&quot;true&quot;);</p> <p>2.在IFRAME中操作 选中父窗口中的所有单选钮<br /> $(window.parent.document).find(&quot;input[@type=&#39;radio&#39;]&quot;).attr(&quot;checked&quot;,&quot;true&quot;);</p> <p>iframe框架的:<iframe frameborder="0" height="300" id="iframe1" scrolling="auto" src="test.html" width="700"></iframe></p> <p>IE7中测试通过</p>
RangeTime:0.006728s
RangeMem:204.34 KB
返回顶部 留言