freeze-element

freeze-element

The freeze-element snippet freezes a DOM element, preventing new nodes from being added inside the element.

Parameters

Name

Description

Example

Mandatory

property

The CSS selector for the parent element to freeze.

'.left-content .container'

Yes

options

Options string, separated by +. Available: subtree, abort.

'' or subtree or abort or subtree+abort

No

exceptions

Array of selectors/regex for nodes to allow.

.article #banner /.*/

No

Filter examples

Filter

Result

freeze-element ol#b_results

Blocks any addition of an immediate child to ol#b_results.

freeze-element ol#b_results subtree

Blocks any addition to the entire subtree of ol#b_results.

freeze-element ol#b_results '' .organic-result

Blocks additions except elements with organic-result class.

freeze-element ol#b_results '' .organic-result /.*/

Blocks additions except organic-result elements and any text node.

freeze-element ol#b_results abort

Throws an error for any addition to ol#b_results.

freeze-element ol#b_results abort+subtree .organic-result

Throws an error for subtree additions except organic-result.