简体   繁体   English

如何获取被TinyMCE编辑器替换的textarea的id属性

[英]How to get the id attribute of textarea that replaced by TinyMCE editor

I am using TinyMCE in my project.I want to get the id attribute of the textarea that is replaced by TinyMCE.Once I get the id of that textarea, then how can I use that id for my jquery functionality like focus,blur,keyup etc. Please give me an example for focus event for that textarea (editor) just by alert something when someone press a key inside the textarea (editor) 我在我的项目中使用TinyMCE。我想要获取被TinyMCE替换的textarea的id属性。一旦我获得了那个textarea的id,那么我该如何将该id用于我的jquery功能,如focus,blur,keyup等等。请给我一个有关该文本区域(编辑器)的焦点事件的示例,仅在有人按下文本区域(编辑器)内的某个键时发出警报

I have been stuck with this issue for the last 4 days. 在过去的4天中,我一直被这个问题困扰。 So any help in this Please. 因此,对此有任何帮助。

Thanks. 谢谢。

Not a final answer, but too many advices for a comment. 这不是最终的答案,但有太多建议可以发表评论。

There's a jQuery package that "Contains special jQuery build of TinyMCE and a jQuery integration plugin" . 有一个jQuery包“包含TinyMCE的特殊jQuery构建和jQuery集成插件”

Some information about event-handling: eg the focus event . 有关事件处理的一些信息:例如focus event Notice the tinymce.activeEditor -snippet. 请注意tinymce.activeEditor -snippet。

If you've just one init for one textarea, you should know the selector : 如果一个文本区域只有一个init,则应该知道选择器

tinymce.init({
    // your textarea has the class "myeditor"
    // access with jQuery: $('textarea.myeditor').anyFunction();
    selector: "textarea.myeditor" 
});

Maybe it helps you a little. 也许对您有所帮助。 Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM