setStyles

public function setStyles(e:Element/String/Array, o:Object):void
Sets multiple styles on the specified element(s).

Examples

// Sets styles on all paragraphs in the currently active editor
tinyMCE.activeEditor.dom.setStyles(tinyMCE.activeEditor.dom.select('p'), {'background-color' : 'red', 'color' : 'green'});

// Sets styles to an element by id in the current document
tinyMCE.DOM.setStyles('mydiv', {'background-color' : 'red', 'color' : 'green'});

Params

Name Type Description
e Element/String/Array DOM element, element id string or array of elements/ids to set styles on.
o Object Name/Value collection of style items to add to the element(s).