您的位置:首页 > Web前端 > JavaScript

JS 获取 iframe内元素,及iframe与html调用

2016-05-21 22:40 381 查看
两种获得iframe内元素的方法

jquery获取
$("#atrDialogIframe_protocoliframe").contents().find('span').text()

JS原生获取
document.getElementById("atrDialogIframe_protocoliframe").contentWindow.document.getElementById("span")

iframe调用上级窗口的JS

window.parent.上级方法;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: