setContent of an textarea with tinyMCE

后端 未结 8 1841
无人及你
无人及你 2020-12-25 14:33

I have some textareas and all of them are with tinyMCE.

I would like to set the content of the specific textarea, but I can\'t find how.

I have tryed this:

8条回答
  •  [愿得一人]
    2020-12-25 15:17

    Using this

    tinyMCE.get('title').setContent(selected_article_title);
    

    won't work. It will set your editor content.

    To set the editor source html element (the textarea) you will need to set it directly using

    $('#title').html(selected_article_title);
    

    You need to be aware that your editor is not that same as the textarea!

提交回复
热议问题