js获取同级页面中的对象

步骤:

1.从子页面获取上层或顶层页面对象

2.通过上层页面对象获取另一个iframe中的页面对象

实现:

1.window.parent 或 window.top

2.window.parent.document.getElementById("iframeid").contentWindow.document.getElementById("") 或 window.top.document.getElementById("iframeid").contentWindow.document.getElementById("")