[jquery iframe]jQuery在iframe里取得父窗口的某个元素的值涛

更新时间:2017-04-15    来源:jquery    手机版     字体:

【www.bbyears.com--jquery】

1.在父窗口中获取指定iframe(testiframe) id 为 testid 的class

 代码如下 $(window.frames["testiframe"].document).find("#testid").attr("class");

2.在IFRAME中获取父窗口中id为testid的class

 代码如下 $(window.parent.document).find("#testid").attr("class");

iframe框架的:

 代码如下

本文来源:http://www.bbyears.com/wangyezhizuo/31940.html

猜你感兴趣