Using alt attributes on images used as submit buttons

ID: H36

Technology: html

Type: Technique

When to Use

Applies to content using image-based submit buttons.

Description

For input elements of type image, the alt attribute of the input element is used to provide a functional label. This label indicates the button's function, but does not attempt to describe the image. The label is especially important if there are multiple submit buttons on the page that each lead to different results.

Examples

An input element with an alt attribute

<form action="/find" method="post" role="search">
  <label for="look-up">Find books<label>
  <input id="look-up" type="text">
  <input alt="Search" src="button.gif" type="image">
</form>

Tests

Procedure

  1. For all input elements that have a type attribute value of image, check for the presence of an alt attribute.
  2. Check that the value of the alt attribute describes the button's function.

Expected Results

Resources