# Buttons and Links

## Prerequisites

These steps assume that the following tests have been completed and that issues found have been resolved:

* [Focus Moveable](https://ebay.gitbook.io/oatmeal/keyboard/focus-is-not-trapped)
* [Focus Visible](https://ebay.gitbook.io/oatmeal/keyboard/focus-is-visible)
* [Focus Reachable](https://ebay.gitbook.io/oatmeal/keyboard/keyboard-reachable)

To help identify and distinguish between buttons and links, read **Button vs Link** in the knowledge section below.&#x20;

## Steps

For each [keyboard reachable](https://ebay.gitbook.io/oatmeal/keyboard/keyboard-reachable) button and link control that you have identified on the page, perform the following steps:

1. Move keyboard focus by pressing TAB or SHIFT+TAB until you reach the control
2. Activate the control with the ENTER key
3. If the control **doesn't work**, create an issue
   1. see **Enter doesn't activate button/link** below

For **buttons only**, perform the following additional steps:

1. Move keyboard focus by pressing TAB or SHIFT+TAB until you reach the button
2. Activate the button with the SPACE key
3. If the button **doesn't work**, create an issue
   1. see **Space doesn't activate button** below

## Creating Issues

Make sure you provide enough information to identify each button and link with issues.

Your team may wish to list all failures of this check in one issue.

### Enter doesn't activate button/link

* **Description**: Enter doesn't activate button/link
* **Priority**:&#x20;
  * Link: P1
  * Button: P1 if SPACE key also doesn't work (see below)
  * Button: P2 if SPACE key does work
* **Label or Tag**: #a11y211

### Space doesn't activate button

* **Description**: Space doesn't activate button
* **Priority**: P3
* **Label or Tag**: #a11y211

## Knowledge

### Button vs Link

Whether something is a button or a link is defined by the function it performs; not by its visual appearance.

**Links**:

* cause a full page load
* have options similar to the following in their context menu:
  * Open link in new tab
  * Open link in new window
  * Save link as...
  * Copy link address
  * etc.
* programmatically convey a "visited" state

**Buttons**:

* perform actions on the page
* don't have link-specific options in their context menu
* don't convey a "visited" state
* can cause a page load (e.g. form submit button)

## About

Author(s): Ian McBurnie & Luis Garcia

Last Updated: 2021 January 27th


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ebay.gitbook.io/oatmeal/keyboard/buttons-and-links.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
