Home   Pricing

editor.insertRootParagraph(tagname)

This method is used for inserting a new paragraph at the bottom of editor.

Syntax

editor.insertRootParagraph(tagname)

Parameter

Type: String

Optional. The tag name (div, br, p). If not specified, the tag defined by config.enterKeyTag will be inserted.

Return Value

Type: HTMLElement

The HtmlElement that was just inserted. If insertion failed, this will return null.

Example:

  1. var editor1 = new RichTextEditor("#div_editor1");      
  2. for(var i=1;i<10;i++)  
  3. {  
  4.    editor1.selectDoc(false);  
  5.    var p=editor1.insertRootParagraph("P");  
  6.    p.innerText="paragraph "+i;  
  7. }