简体   繁体   中英

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)

I have been stuck with this issue for the last 4 days. 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" .

Some information about event-handling: eg the focus event . Notice the tinymce.activeEditor -snippet.

If you've just one init for one textarea, you should know the selector :

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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