Focus / Blur Test: Anchor [href] Elements

This page provides several tests to illustrate how a browser handles the focus and blur events for <a href> elements. Each test in the grid below has uniquely defined properties. The first test is the default button element with no tabindex defined. Each subsequent test specifies a value for tabindex, with two being an undefined (i.e. invalid) value.

onfocus and onblur event handlers have been bound to each of the test case controls. If triggered, an event handler will log the event in the Test Results box to the right of the test grid. The focus event handler modifies the styling of the button to illustrate cases where the element has focus but the browser does not provide any visual indication. The event handlers do not consume the event (i.e. they allow propagation). This allows the test to record the event but not affect the browser's default behavior.

The reset buttons will clear the Test Results.

Test Properties  
1 href = "#" href 1
2 href = "#" tabindex = "0" href 2
3 href = "#" tabindex = "-1" href 3
4 href = "#" tabindex = "" href 4
5 href = "#href-tests" href 5
6 href = "#href-tests" tabindex = "0" href 6
7 href = "#href-tests" tabindex = "-1" href 7
8 href = "#href-tests" tabindex = "" href 8
Test Results

Previously Found Results

Browser OS Element Properties Test Results Notes
focus blur visual focus visual blur
 

HTML Source Code

Show HTML Source Code: href.inc

Javascript Source Code

Show Javascript Source Code: href.js

CSS Source Code

Show CSS Source Code: focus.css

W3C Validation of HTML5