Textbox.io 2.x Documentation : editor.filters.selector.addInput()

Create a selector based input filter for an editor instance with editor.filters.selector.addInput().

The selector based input filter modifies content added to an editor with: textboxio.replace(), editor.content.set()editor.content.insertHtmlAtCursor().

Example

editor.filters.selector.addInput(selector, callback)
// Create an input filter for elements with class 'blue' that strips classes from identified elements
editor.filters.selector.addInput('.blue', function(elements) {
    elements.forEach(function(element) {
        element.className = "";
    });
});

Parameters

selectorStringSpecify a CSS3 selector representing the elements you wish to pass to the filter.
callbackFunctionSpecify a function to process the array of matched elements.

Returns

No return value.

See Also

Filtering Content