applyStyle

Availability: >= 3.0

Type: Object Method

Description: Applies a WysiwygPro style to the current selection or insertion point.

Syntax:

editor.applyStylestring style [, array nodes]);

Parameters:

style
A WysiwygPro style.

nodes
An array or collection of elements to apply the style to. If this attribute has been set the style will be applied to these elements instead of the selection.

Example:

The following example would wrap the current selection in a span tag with a className of warning:

WPro.editors['editorName'].applyStyle('span class="warning"');