unmark() method
Syntax
// javascript
const instance = new Mark(context);
instance.unmark([options]);
// jQuery
$(context).unmark([options]);
Parameters:
options
object - Optional options:
Option | Type | Default | Description |
---|---|---|---|
element | string | mark | Specifies marked elements to remove.
Important: if other than default marked element is used, e.g. |
className | string | '' | Remove only marked elements with specified class name. |
exclude | string or string[] | [] | A string or an array of selectors. Specifies DOM elements that should be excluded from searching. |
shadowDOM | boolean | undefined | Whether to remove marked elements inside shadow DOMs
Note: if the |
iframes | boolean | false | Whether to search inside iframes
Note: if the |
iframesTimeout | number | 5000 ms | The max time to wait for iframe(s) to load before skipping |
debug | boolean | false | Whether to log messages |
log | object | console | Log messages to a specific object |
done | function | A callback after all specified marked elements were removed
done : () => {} It has no parameters. |
Example with default options values
const options = {
element : 'mark',
className : '',
shadowDOM : false,
iframes : false,
iframesTimeout : 5000,
done : () => {},
debug : false,
log : window.console
};
JavaScript:
var instance = new Mark(document.querySelector('selector'));
instance.unmark(options);
jQuery:
$('selector').unmark(options);