Element

a

Error Type

Likely

Guidelines

  • BITV 1.0 (Level 2)
    Guideline GroupLevel 1
    Guideline Subgroup10.1 Until user agents allow users to turn off spawned windows, do not cause pop-ups or other windows to appear and do not change the current window without informing the user.
  • WCAG 1.0 (Level AA)
    Guideline GroupPriority 2
    Guideline Subgroup10.1 Until user agents allow users to turn off spawned windows, do not cause pop-ups or other windows to appear and do not change the current window without informing the user.
  • WCAG 1.0 (Level AAA)
    Guideline GroupPriority 2
    Guideline Subgroup10.1 Until user agents allow users to turn off spawned windows, do not cause pop-ups or other windows to appear and do not change the current window without informing the user.
  • WCAG 2.0 (Level AAA)
    Guideline Group3.2 Predictable: Make Web pages appear and operate in predictable ways.
    Guideline SubgroupSuccess Criteria 3.2.5 Change on Request (AAA)

Requirement

Anchor should not open new window without warning.

Error

Anchor that opens new window may be missing warning.

Short Description

a (anchor) element must not contain a target attribute unless the target attribute value is either _self, _top, or _parent.

How To Determine

Question Does this anchor open a new window without warning?
PASS There is a warning to user that anchor opens a new window.
FAIL User is not given warning that anchor opens a new window.

Steps To Check

Procedure

1. Check each a (anchor) element that contains a target attribute.
2. Ignore an a (anchor) elements that contain a target attribute value of _self, _top, or _parent.
3. Check the document text to see if there is a warning to the user that the a (anchor) element opens a new window.

Expected Result

1. The document is expected to contain a warning that the a (anchor) elements opens a new window.

Failed Result

1. Add a warning to the user that the a (anchor) element opens a new window.

Examples

Pass Examples

a (anchor) element has target of "_self".
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #18 - Negative</title>
</head>
<body>
<a href="newwindow.html" target="_self">same window</a>
</body>
</html>

Fail Examples

a (anchor) element has target of "_new".
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #18 - Positive</title>
</head>
<body>
<a href="newwindow.html" target="_new">new window</a>
</body>
</html>
Web site engine's code is copyright © 2023
Inclusive Design Institute