The ‘aria-hidden’ attribute plays an important role in context of web-accessibility. It is a simple way to make web content/applications more accessible to people with disabilities. This attribute is used to indicate that the element and all of its descendants are not visible or perceivable to any user as per the implementation. Now in your mind may a question arrived that what is the difference between ‘hidden’ and ‘aria-hidden’ attributes?
The main aspect of making this solution is to make content readable only when content is visible on screen otherwise should remain inaccessible. Here, we’ll be using attr() method to do the same which is used for setting/getting an element’s attribute.
Getter: $([selector]).attr('attribute'); Setter: $([selector]).attr('attribute', 'value');
Below example illustrate the above approach:
- jQuery | Callback Functions
- How to call functions after previous function is completed in jQuery ?
- How to set attribute without value using jQuery ?
- jQuery | [attribute=value] Selector
- jQuery | [attribute~=value] Selector
- jQuery | [attribute^=value] Selector
- jQuery | [attribute!=value] Selector
- jQuery | [attribute] Selector
- jQuery | [attribute*=value] Selector
- jQuery | [attribute$=value] Selector
- jQuery | [attribute|=value] Selector
- How to remove CSS “top” and “left” attribute with jQuery ?
- How to use input readonly attribute in jQuery ?
- How to select elements by attribute in jQuery ?