iframe子页面获取父页面元素的方法
2015-02-10 17:53
225 查看
/article/1251220.html
/article/7080436.html
1、在父窗口中获取iframe中的元素
格式:window.frames["iframe的name值"].document.getElementById("iframe中控件的ID").click();
实例:window.frames["ifm"].document.getElementById("btnOk")
2.获取父元素:
$.('#objld', parent.document);
在父页面获取iframe子页面的元素 :
$("#objid", document.iframes('iframe').document) (这种方法不能使用)
或
$(document.getElementById('iframeId').contentWindow.document.body).html() $(document.getElementById('iframeId').contentWindow.document.body).html()
/article/7080436.html
1、在父窗口中获取iframe中的元素
格式:window.frames["iframe的name值"].document.getElementById("iframe中控件的ID").click();
实例:window.frames["ifm"].document.getElementById("btnOk")
2.获取父元素:
$.('#objld', parent.document);
在父页面获取iframe子页面的元素 :
$("#objid", document.iframes('iframe').document) (这种方法不能使用)
或
$(document.getElementById('iframeId').contentWindow.document.body).html() $(document.getElementById('iframeId').contentWindow.document.body).html()
相关文章推荐
- iframe子页面获取父页面元素的方法
- iframe子页面获取父页面元素的方法
- iframe子页面获取父页面元素的方法
- iframe子页面获取父页面元素的方法
- iframe子页面获取父页面元素的方法
- iframe子页面获取父页面元素的方法
- 获取页面某一元素的绝对X,Y坐标,可以用offset()方法
- Js与Jq 获取页面元素值的方法和差异对比
- jQuery 获取 iframe 父页面与子页面的元素和方法
- jQuery获取各页面中的元素方法
- javascript 获取父页面中元素对象方法
- selenium获取页面元素方法归纳总结
- 个人笔记 js 06 子页面获取父页面的元素的方法
- javascript 获取iframe里页面中元素值的方法
- jQuery获取页面元素绝对与相对位置的方法
- jQuery基础学习5——JavaScript方法获取页面中的元素
- 各种浏览器下的页面元素xpath获取方法
- js中获取页面元素方法总结
- 使用jQuery的data方法来为页面中的某个元素存储数据,(获取焦点,清除默认值)
- 在父页面获取子页面元素值的方法