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")

  • 相关阅读:
    execl csv导出
    input里面check 状态检测
    注意这种方法的判断
    本周,上周,本月,上月
    bootstrap 兼容IE8设置
    js jquery 验证写法
    Jquery radio checked
    最简单的XML转数组
    eq,neq,gt,lt等表达式缩写
    python中的注释
  • 原文地址:https://www.cnblogs.com/zhengziru/p/9148995.html
Copyright © 2011-2022 走看看