TinyMCE:API/tinymce.dom.DOMUtils/setAttribs
From Moxiecode Documentation Wiki
Contents |
[edit]
Method: setAttribs
[edit]
Summary
Sets the specified attributes of a element or elements.
[edit]
Syntax
<void> setAttribs(<Element/String/Array> e, <Object> o)
[edit]
Parameters
- e
- DOM element, element id string or array of elements/ids to set attributes on.
- o
- Name/Value collection of attribute items to add to the element(s).
[edit]
Examples
// Sets some attributes to all paragraphs in the active editor
tinyMCE.activeEditor.dom.setAttribs(tinyMCE.activeEditor.dom.select('p'), {'class' : 'myclass', title : 'some title'});
// Sets some attributes to a specific element in the current page
tinyMCE.DOM.setAttribs('mydiv', {'class' : 'myclass', title : 'some title'});
