Definir e obter conteúdo HTML
Este guia mostra as formas mais comuns de definir e obter conteúdo HTML no RichTextEditor.
1. Obter o conteúdo com JavaScript
<!-- Create a new DIV element with all of the content that we want inside the Editor -->
<div id="div_editor1"></div> //Initialize Richtexteditor for the matched element
var editor1 = new RichTextEditor("#div_editor1");
//Setting Content with Javascript
editor1.setHTMLCode("Use inline HTML or setHTMLCode to set the default content.");<!-- Retrieve the HTML from the editor by using the editor.getHTMLCode() method. -->
<button onclick="alert(editor1.getHTMLCode())">Show Html Code</button>2. Obter o conteúdo automaticamente com um POST de <form> HTML
Quando o RichTextEditor substitui um elemento <textarea> dentro de um <form>, ele reproduz o comportamento do <textarea> original no envio do formulário. Ou seja, o conteúdo do editor é simplesmente enviado junto com os outros elementos do formulário, usando o atributo name do <textarea> original como chave.
<!-- Create a new DIV element with all of the content that we want inside the Editor -->
<textarea id="inp_editor1"><p>Initial Document Content</p></textarea>//Initialize Richtexteditor for the matched element
var editor1 = new RichTextEditor("#inp_editor1");