父窗口中操作iframe:

$(window.frames["iframeChild"].document) //假如iframe的id为iframeChild

在子窗口中操作父窗口:

$(window.parent.document) 

接下来就可以继续获取iframe内的dom了。

获取iframe内的dom对象有两种方法

1 $(window.frames["iframeChild"].document).find("#child")
2 $("#child",window.frames["iframeChild"].document)

1.在父窗口中操作 选中IFRAME中的所有单选按钮

$(window.frames["iframeChild"].document).find("input[@type='radio']").attr("checked","true"); 

2.在IFRAME中操作 选中父窗口中的所有单选按钮

$(window.parent.document).find("input[@type='radio']").attr("checked","true"); 

Jquery-获取iframe中的dom对象的更多相关文章

  1. jquery获取iframe中的dom对象

    父窗口中操作iframe:$(window.frames["iframeChild"].document)    //假如iframe的id为iframeChild 在子窗口中操作 ...

  2. Js/Jquery获取iframe中的元素

    转载: Js/Jquery获取iframe中的元素 - - ITeye技术网站http://java-my-life.iteye.com/blog/1275205 在web开发中,经常会用到ifram ...

  3. JQuery获取iframe中window对象的方法-contentWindow

    document.getElementsByTagName('iframe')[0].contentWindow 获取到的就是iframe中的window对象.

  4. 【学习】如何用jQuery获取iframe中的元素

    (我的博客网站中的原文:http://www.xiaoxianworld.com/archives/292,欢迎遇到的小伙伴常来瞅瞅,给点评论和建议,有错误和不足,也请指出.) 说实在的,以前真的很少 ...

  5. javascript 获取iframe中的dom

    太扯了,一个多小时都没搞定,获取不到iframe中的dom元素. <div id="one"> this is one </div> <div> ...

  6. Js/Jquery获取iframe中的元素 在Iframe中获取父窗体的元素方法

    在web开发中,经常会用到iframe,难免会碰到需要在父窗口中使用iframe中的元素.或者在iframe框架中使用父窗口的元素 js 在父窗口中获取iframe中的元素  1. 格式:window ...

  7. Jquery获取iframe中的元素

    iframe与父页面之间相互获取元素的方法: 1.从父页面中获取iframe页面中的元素: 用法: $(window.frames["iframe_include_adverse" ...

  8. jquery获取html中当前元素对象,以及父对象,相邻的上一个对象,或下一个对象

    jsp代码: <span><input type="hidden" value="1" id="newInfo">& ...

  9. 如何利用JQuery获取iframe内联框架对象?

    parent.$("#iframeID").get(0).contentWindow; 父.$("选择器").get(0).contentWindow; get ...

随机推荐

  1. BeanShell Assertion in Jmeter

    以下为几个beanshell assertion的栗子: if (ResponseCode != null && ResponseCode.equals ("200" ...

  2. 嵌入式Linux驱动学习之路(八)创建最小的根文件系统

    busybox 在配置busybox,在是否选择要静态链接库时,在静态下,busybox中的工具不需要动态链接库,能够直接运行.而用户自己编写的程序如果需要动态链接库,还是依然需要有. 如果是动态链接 ...

  3. gnuplot 的安装

    需要同时安装gnuplot和gnuplot-x11才能画出图 sudo apt-get install gnuplot gnuplot-x11 gnuplot not showing the grap ...

  4. 全球首发免费的MySql for Entity Framework Core

    from:http://www.1234.sh/post/pomelo-data-mysql?utm_source=tuicool&utm_medium=referral Source 源代码 ...

  5. Java多态:upcast和downcast

    upcast例: public class Test { public static void main(String[] args) { Cup aCup = new BrokenCup(); aC ...

  6. 针对苹果最新审核要求为应用兼容IPv6

    在WWDC2015上苹果宣布iOS9将支持纯IPv6的网络服务.2016年初开始所有提交到App Store的应用必须支持IPv6.为确保现有的应用是兼容的,我们需要注意下面几点. 不建议使用底层的网 ...

  7. Winform调用系统的剪切,复制,粘贴文件功能

    // <summary> /// 复制或剪切文件至剪贴板(方法) /// </summary> /// <param name="files"> ...

  8. c++基础 使用智能指针

    三个智能指针模板(auto_ptr.unique_ptr和shard_ptr)都定义了类似指针的对象(c++11已将auto_ptr摒弃),可以将new获得(直接或间接) 的地址赋给这种对象.当智能指 ...

  9. WPF路径动画(动态逆向动画)

    WPF 中的Path.Data 不再多介绍,M开始坐标点 C弧度坐标点 L 直线坐标点 <Path x:Name="path0" Data="M 10,100 C ...

  10. 一起写一个JSON解析器

    [本篇博文会介绍JSON解析的原理与实现,并一步一步写出来一个简单但实用的JSON解析器,项目地址:SimpleJSON.希望通过这篇博文,能让我们以后与JSON打交道时更加得心应手.由于个人水平有限 ...