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

两种获得iframe内元素的方法

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

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

iframe调用上级窗口的JS

  window.parent.上级方法;

原文地址:https://www.cnblogs.com/phplhs/p/5515810.html