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

后端 未结 13 2005
慢半拍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:41

    Finally found an answer... use the command:

    tinymce.execCommand('mceFocus',false,'id_of_textarea');
    

    For my purposes, 'id_of_texterea' was "description", ie

    
    

    In the form element that preceded my textarea, I added the execCommand above to the element's "onblur" action.

提交回复
热议问题