select

public function select(p:String, s:Object):Array
Selects specific elements by a CSS level 3 pattern. For example "div#a1 p.test". This function is optimized for the most common patterns needed in TinyMCE but it also performes good enough on more complex patterns.

Examples

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

// Adds a class to all spans that has the test class in the currently active editor
tinyMCE.activeEditor.dom.addClass(tinyMCE.activeEditor.dom.select('span.test'), 'someclass')

Params

Name Type Description
p String CSS level 1 pattern to select/find elements by.
s Object Optional root element/scope element to search in.

Returns

Array Array with all matched elements.