js怎么在当前页面获取iframe中的元素

如题所述

首先你要能获取到这个iframe的dom对象,假设我们知道它的ID;

var frame = document.getElementById("ueditor_0");
var frameDocument = frame.contentWindow.document;

iframe中的document对象拿到了,后边如何获取你想要的元素就很简单了吧。

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜