addClass

public function addClass(Element:String/Element/Array, c:String):String/Array
Adds a class to the specified element or elements.

Examples

// Adds a class to all paragraphs in the active editor
tinyMCE.activeEditor.dom.addClass(tinyMCE.activeEditor.dom.select('p'), 'myclass');

// Adds a class to a specific element in the current page
tinyMCE.DOM.addClass('mydiv', 'myclass');

Params

Name Type Description
Element String/Element/Array ID string or DOM element or array with elements or IDs.
c String Class name to add to each element.

Returns

String/Array String with new class value or array with new class values for all elements.