hide-if-contains-and-matches-style

The hide-if-contains-and-matches-style snippet hides any HTML element (or its ancestors) that matches a CSS selector if the element's text content contains a given string and, optionally, if the element's computed style contains a given string.

You can use this snippet to hide an element based on text content and style.

Parameters

Filter examples

The following table lists examples that use the hide-if-contains-and-matches-style snippet:

Last updated