---
url: "https://www.w3.org/WAI/WCAG22/Techniques/failures/F42"
titulek: "F42: Failure of Success Criteria 1.3.1, 2.1.1, 2.1.3, or 4.1.2 when emulating links | WAI | W3C"
h1: "Technique F42:Failure of Success Criteria 1.3.1, 2.1.1, 2.1.3, or 4.1.2 when emulating links"
popis: ""
jazyk: "en"
kanonicka: ""
drobecky: []
zdroj: "live"
wayback_snapshot: ""
stazeno: "2026-09-14 04:43:10"
znaku: 4845
slov: 667
kodovani: "utf-8"
sha256: "37714e8faeeae5f933d3db3ce6e2268e1396d69e78ae5290872d4831446212ce"
---
# Technique F42:Failure of Success Criteria 1.3.1, 2.1.1, 2.1.3, or 4.1.2 when emulating links
## About this Technique
This technique relates to:
- [1.3.1 Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships) ( **Failure** )
- [2.1.1 Keyboard](https://www.w3.org/WAI/WCAG22/Understanding/keyboard) ( **Failure** )
- [4.1.2 Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value) ( **Failure** )
This failure applies to HTML.
Failure techniques show examples of how content can fail particular WCAG success criteria. However, content may still satisfy those criteria if it includes equivalent/alternative content or functionality that **does** meet the normative requirements. See [About WCAG Techniques](https://www.w3.org/WAI/WCAG22/Techniques/about).
## Description
This failure occurs when JavaScript event handlers are attached to elements
to emulate links. A link created in this manner cannot be tabbed to from the keyboard and does not gain keyboard focus like other controls and/or links.
If scripting events are used to emulate links, user
agents including assistive technology may not be able to identify the links
in the content as links. They may be recognized as interactive controls but still not recognized as links. Such elements do not appear in the links
list generated by user agents or assistive technology.
Note
It is possible to use the ARIA `role` attribute to identify an anonymous element as link control for assistive technologies. However, best practice for ARIA calls for [making use of native elements whenever possible](https://www.w3.org/TR/aria-in-html/#rule1) , so the use of the `role` attribute to identify anonymous elements as links is not recommended.
The `a` and `area`
elements are intended to mark up links.
## Examples
### Example 1: Scripting a `span` element
Scripted event handling is added to a `span` element so
that it functions as a link when clicked with a mouse. Assistive
technology does not recognize this element as a link.
```
Fake link
```
### Example 2: Scripting an `img` element
Scripted event handling is added to an `img` element so
that it functions as a link when clicked with a mouse. Assistive
technology does not recognize this element as a link.
```
```
### Example 3: Scripting an `img` element, with keyboard
support
Scripted event handling is added to an `img` element so
that it functions as a link. In this example, the link functionality
can be invoked with the mouse or via the Enter key if the user agent
includes the element in the tab chain. Nevertheless, the element
will not be recognized as a link.
```
function doNav(url){
window.location.href = url;
}
function doKeyPress(url){
if (window.event.type == "keypress" && window.event.keyCode == 13){
doNav(url);
}
}
```
The markup for the image is:
```