W3CWeb Accessibility Initiative Home

ONMOUSEOVER and ONMOUSEOUT

On this page: Test 1 | Test 2 | Test 3 | References | About these tests

Nearby: More HTML 4.01 Tests | UAAG 1.0 Test Suite

UAAG 1.0 Requirement

Checkpoint 1.2 Activate event handlers (Priority 1 )
Provision 2 : In order to satisfy provision one of this checkpoint, the user must be able to activate as a group all event handlers of the same input device event type. For example, if there are 10 handlers associated with the onmousedown event type, the user must be able to activate the entire group of 10 through keyboard input alone, and must not be required to activate each handler separately.

Test 1 :

Procedure

  1. Using the keyboard or an assistive technology that emulates the keyboard, navigate to the image link and activate the ONMOUSEOVER event.
  2. Using the keyboard or an assistive technology that emulates the keyboard, navigate off the image link and activate the ONMOUSEOUT event.

Run test

Lamp turned off

Expected results

  1. Image swaps with keyboard command

Source code

<p>
  <a href="../action/return.html" shape="rect">
    <img id="lamp1" onmouseover="imgChange1('../images/tn_desklamp1.gif')" onmouseout="imgChange1('../images/desklamp2.gif')" src="../images/desklamp2.gif" height="32" width="25" alt="Lamp turned off" border="0" name="lamp1"></img>
  </a>
</p>

Test Script Code

function imgChange1( img ) { document.lamp1.src = img; }

Test 2 :

Procedure

  1. Using the keyboard or an assistive technology that emulates the keyboard, navigate to the image and activate the ONMOUSEOVER event.
  2. Using the keyboard or an assistive technology that emulates the keyboard, navigate off the image and activate the ONMOUSEOUT event.

Run test

lamp-off

Expected results

  1. Image swaps with keyboard command

Source code

<p>
  <img id="lamp2" onmouseover="imgChange2('../images/tn_desklamp1.gif')" onmouseout="imgChange2('../images/desklamp2.gif')" src="../images/desklamp2.gif" height="32" width="25" alt="lamp-off" border="0" name="lamp2"></img>
</p>

Test Script Code

function imgChange2( img ) { document.lamp2.src = img; }

Test 3 :

Procedure

  1. Using the keyboard or an assistive technology that emulates the keyboard, navigate to the form element and activate the ONMOUSEOVER event.
  2. Using the keyboard or an assistive technology that emulates the keyboard, navigate off the form element and activate the ONMOUSEOUT event.

Run test

Expected results

  1. Button color changes with keyboard command

Source code

<form action="../action/return.html" method="post" onmouseover="change('lightblue')" onmouseout="change('red')" enctype="application/x-www-form-urlencoded">
  <input class="initial2" style="background-color: red" type="button" value="Test"></input>
</form>

Test Script Code

function change(color) { var el=event.srcElement if (el.tagName=="INPUT" && el.type=="button") event.srcElement.style.backgroundColor=color }

References

  1. HTML 4.01 specification for ONMOUSEOVER
  2. HTML 4.01 specification for ONMOUSEOUT

About this test suite

This test is part of a test suite for the User Agent Accessibility Guidelines (UAAG) 1.0 . This work is conducted by the User Agent Accessibility Guidelines Working Group , which is part of W3C's Web Accessibility Initiative (WAI) . Please send comments on this test to w3c-wai-ua@w3.org ( public archive ).


Test created by:

Last modified: $Date: 2003/04/02 23:46:28 $ by $Author: jongund $