Redactor / Examples

Code

<div id="entry-get-set-content"></div>
const app = Redactor('#entry-get-set-content', {
    content: '<p>Initial content.</p>'
});

console.log(app.getContent());

app.setContent('<h2>Updated title</h2><p>New body.</p>', { caret: 'end' });