• createRange (document) : Range
    Creates a W3C-compatible Range object.

    Example

    var editor = $("#editor").data("kendoEditor");
    
    var range = editor.createRange();

    Parameters

    document: Document
    The document that the range is associated with. If ommited, the document of the editor editing area will be used.
    Returns
    Range The created Range object.
  • encodedValue ()
    Gets the HTML encoded value of the editor.
  • exec (name, params)
    Executes an editor command on the currently selected text.

    Example

    var editor = $("#editor").data("kendoEditor");
    
    editor.exec("bold");
    
    editor.exec("undo");
    
    editor.exec("foreColor", { value: "#ff0000" });

    Parameters

    name: String
    The name of the command to be executed.
    params: String
    The parameters for the executed command.
  • focus ()
    Focuses the editable area.
  • getRange () : Range
    Gets a Range object form the editable area.

    Example

    var editor = $("#editor").data("kendoEditor");
    
    var range = editor.getRange();
    Returns
    Range A W3C-compatible Range object that represents the currently selected text in the editor area.
  • getSelection ()
    Gets a W3C-compatible Selection object form the editable area.
  • paste (html)
    Pastes HTML into the editable area.

    Example

    var editor = $("#editor").data("kendoEditor");
    
    editor.paste("<p>new content</p>");

    Parameters

    html: String
    The HTML to be pasted.
  • selectedHtml () : String
    Serializes the currently selected text to a XHTML string.
    Returns
    String The selectied text as valid XHTML.
  • selectRange (range)
    Focuses the editable area and selects the range described by the range parameter.

    Example

    var editor = $("#editor").data("kendoEditor"),
        range = editor.createRange();
    
    range.selectNodeContents(editor.body);
    
    editor.selectRange(range);

    Parameters

    range: Range
    The Range object that describes the new selection.
  • update ()
    Serializes the current state of the editable area to the