elRTE JavaScript API (branch 1.x)¶
Get editor content¶
var content = $('selector').elrte('val');
Set content¶
var html_code = '<p>This is example <strong>HTML</strong> code.</p>';
$('selector').elrte('val', html_code);
Update textarea value¶
When you submit from with own JS function and want to force editor to put current contents to the hidden textarea:
$('selector').elrte('updateSource');
Remove/destroy editor¶
Added in version 1.3
Will completely remove editor from document and return it to previous state with updated content
$('selector').elrte('destroy');