TinyMCE:API/tinymce.dom.DOMUtils/setAttribs

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Method: setAttribs

Summary

Sets the specified attributes of a element or elements.

Syntax

<void> setAttribs(<Element/String/Array> e, <Object> o)

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).

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'});
Personal tools