我们有一个基于 htmlarea 的 RTE 编辑器,其中包含在 iframe 内启用了编辑模式的内容。问题是如何自动将焦点带入编辑器?
最佳答案
其中 IFRAME
的 id
是 myRTE
:
var iframe = document.getElementById("myRTE");
if ( iframe && iframe.contentWindow )
iframe.contentWindow.focus();
关于javascript - 如何在 Firefox 中自动聚焦 RTE 编辑器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/112261/