zoukankan      html  css  js  c++  java
  • js---iframe

    一、获取iframe父页面元素

    1、Jquery方法

    方法一:
                $("#父窗口元素ID",window.parent.document);
                父窗口的父窗口的元素就可以用:$(selector, window.parent.parent.document);
    方法二:
                $(window.parent.document).find(selector);
    方法三:
                $("").parent().find("");

    2、Js方法

    window.parent.document.getElementById("父窗口的元素ID");

    二、在父窗口中获取iframe中的元素 

    1、Jquery方法

    方法一:

                $("#iframe的ID").contents().find("#iframe中的控件ID")

    方法二:

                $("#iframe中的控件ID",document.frames("frame的name").document)

    2、js方法

    方法一:

                window.frames["iframe的name值"].document.getElementById("iframe中控件的ID")

    方法二:

               document.getElementById("iframe").contentWindow.document.getElementById("元素id")

  • 相关阅读:
    架构师技能图谱 V1.2
    CTO 技能图谱
    物联网的技术构架
    东进交换机
    Ipad2
    ipad2 恢复
    论文建议
    SQL归档
    SQL 会议消费记录统计
    javascript中的方法:类方法(静态方法)对象方法 原型方法
  • 原文地址:https://www.cnblogs.com/zhengziru/p/9148995.html
Copyright © 2011-2022 走看看