RichTextEditor Demo
Home Pricing

## editor.setImageForCommand

Adds an image (svg or png) for cmdname to the element. For details, please refer to plugin example.

#### Syntax

`editor.setImageForCommand(element,cmdname)`

###### Return value

`Type: HTMLElement`

`The specified HTML Element.`

###### Return value

`Type: String`

`The name of a command.`

## Example:

1. var editor1 = new RichTextEditor("#div_editor1");
2. var btn=document.createElement("span");
3. btn.style.cssText="width:32px;height:32px;display:inline-block;border:solid 1px darkgreen";
4. editor1.container.parentNode.insertBefore(btn,editor1.container);
5. editor1.setImageForCommand(btn,"bold");