Access Key Table Example

Access Key Example

Example Start

Navigation and Orientation

  • Accesskey 1: Main Content
  • Accesskey 2: Search Form
  • Accesskey 3: Navigation Bar

HTML Source Code


<!-- Links with accesskeys defined -->
<a href="#main" accesskey="1"></a><a href="#nav" accesskey="3"></a>

<!-- Targets of accesskey links -->
<div id="divnav">
  <a name="nav"></a>
  <ul id="nav" title="Main Navigation Bar">
  </ul>
</div>

<div id="content">
<a name="main"></a>
  <p>Navigation and Orientation</p>
</div>
    
<!-- Accesskey assigned to form control -->
<form name="search" title="Search Website" action="search.php" method="post">
  <label>Search Text <input accesskey="2" type="text" name="stext" size="15"></label>
  <input type="submit" value="Start Search">
</form>

<!-- Documentation of the Accesskeys for users -->
<ul class="accesskey">
  <li>Accesskey 1: Main Content</li>
  <li>Accesskey 2: Search Form</li>
  <li>Accesskey 3: Navigation Bar</li>
</ul>