Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我知道如何用鼠标选择文本并在 div 中显示该选择。但是,当我有一个在同一域上显示页面的 iframe 时,我怎么能做同样的事情。
想不通。我已经实施了这里找到的解决方案。
任何可以帮助我的想法或链接到解决此问题的其他 SO 问题?
谢谢!
您可以在此处查看如何获取对window和document的引用iframe(反之亦然,从 中获取对主文档的引用iframe);从那里开始,应该很容易在主文档中执行您当前正在执行的任何操作。
window
document
iframe