Provide a hide-if-labelled-by snippet
Background
For accessibility reasons and regulations, sites should likely provide an aria-labelledby
attribute that describes what's being shown, despite the content if the labelled container.
The anti CV team could surely benefit by having this snippet for those cases where the content is hard to guess.
What to change
Provide a hide-if-labelled-by
snippet that does the following:
- accept a target node that would contain such attribute
- retrieve the related node by ID specified via the
aria-labelledby
attribute - verify that the content of such label contains one or more cases passed as tring or RegExp
- hide that element or, if provided, hide the related ancestor of such element
Edited by Manish Jethani