Documentation

Source

getCode

Returns: String

Return the source code of Redactor.

var html = this.source.getCode();

setCode

Arguments: String

Set the source code of Redactor.

this.source.setCode(html);

getName

Returns: String

Return the name attribute of the source textarea.

var name = this.source.getName();

If you launched Redactor for textarea and it has the name attribute, then getName will return the value of this attribute. If you launched Redactor for other tags or textarea does not have the name attribute, then Redactor automatically generates a value of the name like content-0 where the numeric value is the editor's ordinal number on the page.

getStartedContent

Returns: String

Return the initial HTML content of Redactor.

var html = this.source.getStartedContent();

getElement

Returns: Object

Return the wrapped Dom object of Redactor's source element.

var $source = this.source.getElement();

The source element is the textarea into which Redactor synchronizes the HTML from the editable layer.