--- url: "https://www.w3.org/WAI/WCAG22/Techniques/failures/F59" titulek: "F59: Failure of Success Criterion 4.1.2 due to using script to make div or span a user interface control in HTML without providing a role for the control | WAI | W3C" h1: "Technique F59:Failure of Success Criterion 4.1.2 due to using script to make div or span a user interface control in HTML without providing a role for the control" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 06:29:56" znaku: 3709 slov: 537 kodovani: "utf-8" sha256: "7da4fedec33f86fa3eb7ec42716bc6838b383beff876382187f97706ec09f1b2" --- # Technique F59:Failure of Success Criterion 4.1.2 due to using script to make div or span a user interface control in HTML without providing a role for the control ## About this Technique This technique relates to [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 demonstrates how using generic HTML elements to create user interface controls can make the controls inaccessible to assistive technology. Assistive technologies rely on knowledge of the role and current state of a component in order to provide that information to the user. Many HTML elements have well defined roles, such as links, buttons, text fields, etc. Generic elements such as `div` and `span` do not have any predefined roles. When these generic elements are used to create user interface controls in HTML the assistive technology may not have the necessary information to describe and interact with the control. Note Attaching event handlers to elements that are not normally interactive, such as `span` and `div` , can be disorienting to users. Even if care is taken to provide keyboard access to such elements, users may have a difficult time discovering that there are interactive controls in the content or understanding what type of behavior to expect from them. For example, users may not know which keystrokes are supported by the script to activate the element. Additionally, these elements do not generate the same operating system events as interactive elements, so assistive technology may not be notified when the user activates them. [Accessible Rich Internet Applications (WAI-ARIA)](https://www.w3.org/TR/wai-aria/) describes mechanisms to provide the necessary role and state information to create fully accessible user interface controls. ## Examples ### Example 1 The following example fails because it creates a checkbox using a span and an image. ```
Include Signature