{"id":4527,"date":"2021-05-25T13:35:00","date_gmt":"2021-05-25T17:35:00","guid":{"rendered":"http:\/\/www.equipmentlink.org\/blog\/?p=4527"},"modified":"2021-05-25T10:55:22","modified_gmt":"2021-05-25T14:55:22","slug":"aria-and-labelling","status":"publish","type":"post","link":"http:\/\/www.equipmentlink.org\/blog\/?p=4527","title":{"rendered":"ARIA and Labelling"},"content":{"rendered":"\n<p>ARIA is a very useful tool for making websites accessible but it can be confusing at times.&nbsp; One of the main issues I come across when testing is the improper use of ARIA for labelling and describing.&nbsp; Therefore, this post will try to explain the differences and the situations where you should use them.<\/p>\n<ol>\n<li>Aria-label: This attribute provides a label for an element. It does not provide any visible indication of this label.&nbsp;\n<ol>\n<li>Aria-label is best used for providing information on interactive or image elements. Since it is not visible, it is important to recognize that this only provides information to screen readers.&nbsp;\n<ol>\n<li>This includes things like links, tables, and charts when it feels appropriate. One example is when providing a link with an agency name that a screen reader might not pronounce correctly (such as MDOD).&nbsp; In this instance, providing an \u201caria-label=Maryland Department of Disabilities\u201d on the link helps screen readers properly announce content.<\/li>\n<\/ol>\n<\/li>\n<li>Aria-labelledby: This attribute associates an element with another element that will act as a label. Effectively, it is a programmatic link between two elements.\n<ol>\n<li>Aria-labelledby\u2019s advantage over aria-label is that it uses a visible element to label another. So it is best used when you are intending to provide a visual description of an image or a form field.\n<ol>\n<li>Aria-labelledby works the same way as a HTML &lt;label&gt; element in that it needs a unique ID to work. The best practice is to use a &lt;label&gt; element with the aria-labelledby attribute attached to cover all bases.<\/li>\n<\/ol>\n<\/li>\n<li>Aria-describedby: This is a very similar attribute to aria-labelledby; it works in the same way but is intended for larger descriptions rather than a concise \u201clabel.\u201d\n<ol>\n<li>Aria-describedby is best used for more complex elements, such as charts and infographics. Note that this is still a string that will be read in a single go to screen readers, so don\u2019t try to cram an entire dataset into it.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>In most cases, you want to pair these attributes with HTML tags such as &lt;label&gt; and &lt;longdesc&gt; since some user agents (i.e. browsers, assistive technology) don\u2019t interpret ARIA.&nbsp; Most screen readers will only use one or the other (i.e. NVDA chooses aria-label over &lt;label&gt;).&nbsp; Please note that this is not a replacement for the \u201calt\u201d attribute for images.&nbsp; It is still necessary and best practice to provide alt text on &lt;img&gt; elements.<\/p>\n<p>For more information and examples on these ARIA attributes, please look at the W3\u2019s site.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#aria-label\">https:\/\/www.w3.org\/TR\/wai-aria\/#aria-label<\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#aria-labelledby\">https:\/\/www.w3.org\/TR\/wai-aria\/#aria-labelledby<\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#aria-describedby\">https:\/\/www.w3.org\/TR\/wai-aria\/#aria-describedby<\/a><\/li>\n<\/ol>\n<p>There will be more to come on other ARIA attributes, since ARIA is a really powerful tool.&nbsp; Please continue to follow us!<\/p>\n<div class=\"al2fb_like_button\"><div id=\"fb-root\"><\/div><script type=\"text\/javascript\">\n(function(d, s, id) {\n  var js, fjs = d.getElementsByTagName(s)[0];\n  if (d.getElementById(id)) return;\n  js = d.createElement(s); js.id = id;\n  js.src = \"\/\/connect.facebook.net\/en_US\/all.js#xfbml=1&appId=149587675112835\";\n  fjs.parentNode.insertBefore(js, fjs);\n}(document, \"script\", \"facebook-jssdk\"));\n<\/script>\n<fb:like href=\"http:\/\/www.equipmentlink.org\/blog\/?p=4527\" layout=\"standard\" show_faces=\"true\" share=\"false\" width=\"450\" action=\"like\" font=\"arial\" colorscheme=\"light\" ref=\"AL2FB\"><\/fb:like><\/div>","protected":false},"excerpt":{"rendered":"<p>ARIA is a very useful tool for making websites accessible but it can be confusing at times.&nbsp; One of the main issues I come across when testing is the improper use of ARIA for labelling and describing.&nbsp; Therefore, this post will try to explain the differences and the situations where you should use them. Aria-label: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","ngg_post_thumbnail":0,"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4527"}],"collection":[{"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4527"}],"version-history":[{"count":1,"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4527\/revisions"}],"predecessor-version":[{"id":4528,"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4527\/revisions\/4528"}],"wp:attachment":[{"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4527"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.equipmentlink.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}