How do you set the focus of a TinyMCE textarea element?

后端 未结 13 2001
慢半拍i
慢半拍i 2020-12-29 20:33

I\'m using TinyMCE for a textarea on a page but it doesn\'t play nice in the tabbing order of the other elements.

I can use the following code to capture when I tab

13条回答
  •  时光取名叫无心
    2020-12-29 21:04

    If you're using tinymce with JQuery. The following will work

    $("#id_of_textarea").tinymce().focus();
    

    You can only do this after the editor has initialized though and so you may need to wait on one of its initialization events.

提交回复
热议问题