TinyMCE:API/tinymce.dom.DOMUtils/setStyles
From Moxiecode Documentation Wiki
Contents |
[edit]
Method: setStyles
[edit]
Summary
Sets multiple styles on the specified element(s).
[edit]
Syntax
<void> setStyles(<Element/String/Array> e, <Object> o)
[edit]
Parameters
- e
- DOM element, element id string or array of elements/ids to set styles on.
- o
- Name/Value collection of style items to add to the element(s).
[edit]
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'});
