CKEDITOR - Predefined Text

Asked

Viewed 308 times

1

Does anyone have any idea where I might be placing a predefined text within the textarea?

Example in the image below:

inserir a descrição da imagem aqui

  • 1

    Within the textarea. Ex.: <textarea>texto pré definido</textarea>

  • 1

    How did I not think of this before? Thanks!

1 answer

1


You can pre-define a text by simply adding it to textarea, including HTML tags, because when Ckeditor renders it, tags will also be applied:

<textarea id="editor"><b>texto em negrito</b></textarea>

Another way to insert a text is through the plugin API, using .setData():

var pre_texto = "<b>texto em negrito</b>";
CKEDITOR.instances.editor.setData(pre_texto);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.