hide-if-contains
The hide-if-contains
snippet hides any HTML element (or its ancestors) that match a CSS selector if the element's text contains a given string.
You can use hide-if-contains
to hide elements based on their text content.
Parameters
Name | Description | Mandatory |
---|---|---|
search | A pattern that matches the name of the cookie(s) you want to remove. If the string starts and ends with a slash ( | Yes |
selector | The CSS selector that an HTML element must match for it to be hidden. | Yes |
| The CSS selector that an HTML element containing the given string must match. Defaults to the value of the selector argument. | No |
Filter examples
The following table lists examples that use the hide-if-contains
snippet:
Filter | Result |
---|---|
| Hides any |
| Hides any |
| Hides any |
Last updated