Element

all elements

Error Type

Known

Guidelines

  • BITV 1.0 (Level 2)
    Guideline GroupLevel 1
    Guideline Subgroup6.4 For scripts and applets, ensure that event handlers are input device-independent.
  • Stanca Act
    Guideline GroupRequirement 16: Script/Object Accessible
  • WCAG 1.0 (Level AAA)
    Guideline GroupPriority 2
    Guideline Subgroup6.4 For scripts and applets, ensure that event handlers are input device-independent.

Requirement

All onclick event handlers have an associated onkeypress event handler.

Error

SCRIPT not keyboard accessible - onclick missing onkeypress.

Short Description

Any element that contains an onclick attribute must also contain an onkeypress attribute.

How To Repair

Add a onkeypress handler to your SCRIPT that performs the same function as the onclick function.

Steps To Check

Procedure

1. Check each element in the document for an onclick attribute.
2. If the element contains an onclick attribute then check if it also contains an onkeypress attribute.

Expected Result

1. All onclick event handlers have an associated onkeypress event handler.

Failed Result

1. Add a valid onkeypress attribute to the element.

Examples

Pass Examples

Contains an element that has an onclick attribute and an onkeypress attribute.
<!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 #102 - Negative</title>
</head>
<body>

<INPUT name="num" onclick="foo" onkeypress="bar" value="0">

</body>
</html>

Fail Examples

Contains an element that has an onclick attribute without an onkeypress attribute.
<!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 #102 - Positive</title>
</head>
<body>

<INPUT name="num" onclick="foo" value="0">

</body>
</html>
Web site engine's code is copyright © 2023
Inclusive Design Institute