Home   Pricing

editor.collapse(bStart)

Collapses the current selection to a single point. The bStart is a boolean value.

Syntax

editor.collapse(bStart)

Parameter

Type: boolean

Optional. True collapses the Range to its start, false to its end. If omitted, it defaults to false.

Example:

  1. var editor1 = new RichTextEditor("#div_editor1");    
  2. editor1.setHTMLCode("<b>hello world</b>");  
  3. editor1.selectDoc()  
  4. editor1.execCommand("forecolor","red");  
  5. editor1.collapse(false);