diff --git a/files/en-us/web/accessibility/aria/aria_techniques/using_the_link_role/index.html b/files/en-us/web/accessibility/aria/aria_techniques/using_the_link_role/index.html index 27488e40d7f1ab0..b79400b3ab287e7 100644 --- a/files/en-us/web/accessibility/aria/aria_techniques/using_the_link_role/index.html +++ b/files/en-us/web/accessibility/aria/aria_techniques/using_the_link_role/index.html @@ -5,7 +5,7 @@ - ARIA - Accessibility --- -
This technique demonstrates how to use the link role and describes the effect it has on browsers and assistive technology.
+This article explains how to use the link role and describes the effect it has on browsers and assistive technology.
The link role is used to identify an element that creates a hyperlink to a resource that is in the application or external. When this role is added to an element, tab can be used to change focus to the link, and enter used to execute the link.
@@ -15,7 +15,7 @@When the link role is added to an element, or such an element becomes visible, the user agent should do the following:
+When the link role is added to an element, or when such an element becomes visible, the user agent should do the following:
Assistive technology products should listen for such an event and notify the user accordingly:
This example shows how to implement a fake link using a <span>
element. This includes JavaScript to grab the location and handle navigating to the new location using window.open()
via clicking, and using keyboard, CSS to give the desired visuals of a link, the tabindex="0"
attribute to make it keyboard-focussable, and role="link"
to make it recognized as a link by assistive technology.
This is a huge amount of work just to recreate something you've get for free using the <a>
element, so you should really use that if possible. But this shows that it can be done.
This is a lot of work just to recreate something you get for free using the <a>
element, so use that if possible. But this shows that it can be done.
You should however note that there are still problems with this approach:
+However, there are still problems with this approach:
:visited
styles (e.g. the default purple color for visited links).open()
method counts as being a popup, and certain browsers may issue a warning when you try to activate it, or make you explicitly agree to allowing popups form the domain it exists on.:visited
styles (e.g. the default purple color for visited links).open()
method counts as being a popup, and certain browsers may issue a warning when you try to activate it, or make you explicitly agree to allowing popups form for the domain.