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.
Parameters
|
Name |
Description |
Mandatory |
|---|---|---|
|
search |
The text string to locate. Enclose in |
Yes |
|
selector |
CSS selector identifying which elements to hide. |
Yes |
|
searchSelector |
CSS selector for locating the search text. Defaults to |
No |
Filter examples
|
Filter |
Result |
|---|---|
|
|
Hides any |
|
|
Hides nav elements that have anchor tags with "FAQ" text. |
|
|
Hides list items with matching label content using regex. |