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

后端 未结 13 2009
慢半拍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 20:42

    What actually works is setting an option in the configfile (or jquery file) This option enables you to auto focus an editor instance. The value of this option should be an editor instance id. The editor instance id is the id for the original textarea or

    element that got replaced.

    Example of usage of the auto_focus option:

    tinyMCE.init({
        //...
        auto_focus : "elm1"
    });
    

提交回复
热议问题