Techniques for WCAG 2.0

On this page:

-

# F55: Failure of Success Criteria 2.1.1, 2.4.7, and 3.2.1 due to using script to remove focus when focus is received

## Applicability

Applies to all content that supports script.

User Agent and Assistive Technology Support Notes

- None listed.

This failure relates to:

- Success Criterion 2.1.1 (Keyboard)
  - How to Meet 2.1.1 (Keyboard)
  - Understanding Success Criterion 2.1.1 (Keyboard)
- Success Criterion 2.4.7 (Focus Visible)
  - How to Meet 2.4.7 (Focus Visible)
  - Understanding Success Criterion 2.4.7 (Focus Visible)
- Success Criterion 3.2.1 (On Focus)
  - How to Meet 3.2.1 (On Focus)
  - Understanding Success Criterion 3.2.1 (On Focus)

## Description

Content that normally receives focus when the content is accessed by keyboard may have this focus removed by scripting. This is sometimes done when designer considers the system focus indicator to be unsightly. However, the system focus indicator is an important part of accessibility for keyboard users. In addition, by this practice removes focus entirely, which means the content can only be accessed by a pointer device, such as a mouse.

## Examples

### Failure Example 1

Example Code:

    <input type="submit" onFocus="this.blur();">

### Failure Example 2

Example Code:

    <a onFocus="this.blur()" href="Page.html"><img src="myImage.gif"></a>

### Failure Example 3

Example Code:

    <a href="link.html" onfocus="if(this.blur)this.blur();">Link Phrase</a>

## Resources

No resources available for this technique.

## Related Techniques

(none currently listed)

## Tests

### Procedure

1. Use the keyboard to verify that you can get to all interactive elements using the keyboard.

2. Check that when focus is placed on each element, focus remains there until user moves it.

### Expected Results

- If #2 is false then this failure condition applies and content fails the Success Criterion.

- Top
- Contents
- Intro
- Previous: Failure F54
- Next: Failure F58