recursal/MDN huggingface dataset:
HTMLLinkElement: sheet property
===============================

 The read-only **`sheet`** property of the `HTMLLinkElement` interface
 contains the stylesheet associated with that element.

A stylesheet is associated to an `HTMLLinkElement` if `rel="stylesheet"` is used with `<link>`.

Value
-----

A `StyleSheet` object, or `null` if none is associated with the element.

Examples
--------


```html
<html>
  <header>
    <link rel="stylesheet" href="styles.css" />
    …
  </header>
</html>
```


The `sheet` property of the `HTMLLinkElement` object will return the `StyleSheet` object describing `styles.css`.

Specifications
--------------

| Specification |
| --- |
| CSS Object Model (CSSOM) # dom-linkstyle-sheet |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLLinkElement: crossOrigin property
=====================================

The **`crossOrigin`** property of the `HTMLLinkElement` interface specifies the Cross-Origin Resource Sharing (CORS) setting to use when retrieving the resource.

Value
-----

A string of a keyword specifying the CORS mode to use when fetching the resource. Possible values are:

`anonymous` or the empty string (`""`)

Requests sent by the `HTMLLinkElement` will use the `cors` mode and the `same-origin` credentials mode. This means that CORS is enabled and credentials are sent *if* the resource is fetched from the same origin from which the document was loaded.

`use-credentials`

Requests sent by the `HTMLLinkElement` will use the `cors` mode and the `include` credentials mode. All resources requests by the element will use CORS, regardless of what domain the fetch is from.

If the `crossOrigin` property is specified with any other value, it is the same as specifing as the `anonymous`.

If the `crossOrigin` property is not specified, the resource is fetched without CORS (the `no-cors` mode and the `same-origin` credentials mode).

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-link-crossorigin |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLImageElement.crossOrigin`
* `HTMLMediaElement.crossOrigin`
* `HTMLScriptElement.crossOrigin`
HTMLLinkElement: referrerPolicy property
========================================

 The
 **`HTMLLinkElement.referrerPolicy`**
 property reflects the HTML `referrerpolicy` attribute of the
 `<link>` element defining which referrer is sent when fetching the
 resource.

See the HTTP `Referrer-Policy` header for details.

Value
-----

A string; one of the following:

`no-referrer`

 The `Referer` header will be omitted entirely. No referrer
 information is sent along with requests.


`no-referrer-when-downgrade`

 The URL is sent
 as a referrer when the protocol security level stays the same (e.g.HTTP→HTTP,
 HTTPS→HTTPS), but isn't sent to a less secure destination (e.g. HTTPS→HTTP).


`origin`

 Only send the origin of the document as the referrer in all cases.
 The document `https://example.com/page.html` will send the referrer
 `https://example.com/`.


`origin-when-cross-origin`

 Send a full URL when performing a same-origin request, but only send the origin of
 the document for other cases.


`same-origin`

 A referrer will be sent for same-site origins, but
 cross-origin requests will contain no referrer information.


`strict-origin`

 Only send the origin of the document as the referrer when the protocol security
 level stays the same (e.g. HTTPS→HTTPS), but don't send it to a less secure
 destination (e.g. HTTPS→HTTP).


`strict-origin-when-cross-origin` (default)

 This is the user agent's default behavior if no policy is specified. Send a full URL when performing a same-origin request, only send the origin when the
 protocol security level stays the same (e.g. HTTPS→HTTPS), and send no header to a
 less secure destination (e.g. HTTPS→HTTP).


`unsafe-url`

 Send a full URL when performing a same-origin or cross-origin request. This policy
 will leak origins and paths from TLS-protected resources to insecure origins.
 Carefully consider the impact of this setting.


Examples
--------


```js
const links = document.getElementsByTagName("link");
links[0].referrerPolicy; // "no-referrer"
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-link-referrerpolicy |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* HTTP header `Referrer-Policy`
* `HTMLAnchorElement.referrerPolicy`
* `HTMLAreaElement.referrerPolicy`
* `HTMLIFrameElement.referrerPolicy`
* `HTMLImageElement.referrerPolicy`
HTMLLinkElement: fetchPriority property
=======================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback

 The **`fetchPriority`** property of the
 `HTMLLinkElement` interface represents a hint given to the browser
 on how it should prioritize the preload of the given resource relative to other
 resources of the same type.

Value
-----

A string representing the priority hint. Possible values are:

`high`

 Fetch the preload at a high priority relative to other resources
 of the same type.


`low`

 Fetch the image at a low priority relative to other resources of
 the same type.


`auto`

 Default mode, which indicates no preference for
 the fetch priority. The browser decides what is best for the user.



 The `fetchPriority` property allows you to signal high or low priority preload
 fetches. This can be useful when applied to `<link>` elements
 to signal preloads that are more or less important to the user experience early
 in the loading process.

 The effects of the hint on resource loading is browser-specific so make sure to
 test on multiple browser engines.

 Use it sparingly for exceptional cases where the browser may not be able to
 infer the best way to load the resource automatically. Over use can result in
 degrading performance.

Examples
--------


```js
const preloadLink = document.createElement("link");
preloadLink.href = "myimage.jpg";
preloadLink.rel = "preload";
preloadLink.as = "image";
preloadLink.fetchPriority = "high";
document.head.appendChild(preloadLink);
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # attr-link-fetchpriority |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLLinkElement: relList property
=================================

The **`HTMLLinkElement.relList`** read-only property reflects the `rel` attribute. It is a live `DOMTokenList` containing the set of link types indicating the relationship between the resource represented by the `<link>` element and the current document.

 The property itself is read-only, meaning you can not substitute the
 `DOMTokenList` by another one, but the content of the returned list can be
 changed.

Value
-----

A live `DOMTokenList` of strings.

Examples
--------


```js
const links = document.getElementsByTagName("link");
for (const link of links) {
  console.log("New link found.");
  link.relList.forEach((relEntry) => {
    console.log(relEntry);
  });
}
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-link-rellist |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The equivalent property on `<a>` and `<area>`,
 `HTMLAnchorElement.relList` and `HTMLAreaElement.relList`.
* The very same list but as a space-separated tokens in a string:
 `HTMLLinkElement.rel`
HTMLLinkElement: hreflang property
==================================

The **`hreflang`** property of the `HTMLLinkElement` is used to indicate the language and the geographical targeting of a page. This hint can be used by browsers to select the more appropriate page or to improve SEO.

It reflects the `hreflang` attribute of the `<link>` element and is the empty string (`""`) if there is no `hreflang` attribute.

Value
-----

A string that contains a language tag, or the empty string (`""`) if there is no `hreflang` attribute.

Example
-------


```html
<link
 rel="alternate"
 href="www.example.com/fr/html"
 hreflang="fr"
 type="text/html"
 title="French HTML" />
<p class="tag"></p>
```



```css
.tag {
  margin-left: 20px;
  font: bold;
  font-size: 24px;
}
```



```js
const myLink = document.querySelector("link");
const pTag = document.querySelector(".tag");
pTag.textContent = myLink.hreflang;
```

Results
-------

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-link-hreflang |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLAnchorElement.hreflang` property
Gamepad: pose property
======================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`pose`** read-only property of the `Gamepad` interface returns a `GamepadPose` object representing the pose information associated with a WebVR controller (e.g. its position and orientation in 3D space).

Value
-----

A `GamepadPose` object.

Examples
--------

TBC

Specifications
--------------

| Specification |
| --- |
| Gamepad Extensions # dom-gamepad-pose |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Gamepad API
* WebVR API
Gamepad: buttons property
=========================

 The **`Gamepad.buttons`** property of the `Gamepad` interface returns an array of `gamepadButton` objects representing the
 buttons present on the device.

 Each entry in the array is 0 if the button is not pressed, and non-zero (typically 1.0)
 if the button is pressed. Each `gamepadButton` object has two properties:
 `pressed` and `value`:

* The `pressed` property is a boolean indicating whether the button is
 currently pressed (`true`) or unpressed (`false`).
* The `value` property is a floating point value used to enable
 representing analog buttons, such as the triggers on many modern gamepads. The values
 are normalized to the range 0.0 – 1.0, with 0.0 representing a button that is not
 pressed, and 1.0 representing a button that is fully pressed.
Value
-----

An array of `gamepadButton` objects.

Examples
--------

 The following code is taken from my Gamepad API button demo (you can view the demo live, and
 find the source code on GitHub.) Note the code fork — in Chrome
 `Navigator.getGamepads` needs a `webkit` prefix and the button
 values are stores as an array of double values, whereas in Firefox
 `Navigator.getGamepads` doesn't need a prefix, and the button values are
 stored as an array of `GamepadButton` objects; it is the
 `GamepadButton.value` or `GamepadButton.pressed` properties of
 these we need to access, depending on what type of buttons they are. In this simple
 example I've just allowed either.


```js
function gameLoop() {
  let a = 0;
  let b = 0;
  if (navigator.webkitGetGamepads) {
    const gp = navigator.webkitGetGamepads()[0];

    if (gp.buttons[0] === 1) {
      b--;
    } else if (gp.buttons[1] === 1) {
      a++;
    } else if (gp.buttons[2] === 1) {
      b++;
    } else if (gp.buttons[3] === 1) {
      a--;
    }
  } else {
    const gp = navigator.getGamepads()[0];

    if (gp.buttons[0].value > 0 || gp.buttons[0].pressed) {
      b--;
    } else if (gp.buttons[1].value > 0 || gp.buttons[1].pressed) {
      a++;
    } else if (gp.buttons[2].value > 0 || gp.buttons[2].pressed) {
      b++;
    } else if (gp.buttons[3].value > 0 || gp.buttons[3].pressed) {
      a--;
    }
  }

  ball.style.left = `${a \* 2}px`;
  ball.style.top = `${b \* 2}px`;

  const start = rAF(gameLoop);
}
```

Specifications
--------------

| Specification |
| --- |
| Gamepad # dom-gamepad-buttons |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

Using the Gamepad API
Gamepad: hapticActuators property
=================================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`hapticActuators`** read-only property of the `Gamepad` interface returns an array containing `GamepadHapticActuator` objects, each of which represents haptic feedback hardware available on the controller.

Value
-----

An array containing `GamepadHapticActuator` objects.

Examples
--------


```js
const gamepad = navigator.getGamepads()[0];

gamepad.hapticActuators[0].pulse(1.0, 200);
```

Specifications
--------------

| Specification |
| --- |
| Gamepad Extensions # dom-gamepad-hapticactuators |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Gamepad API
Gamepad: index property
=======================

 The **`Gamepad.index`** property of the `Gamepad`
 interface returns an integer that is auto-incremented to be unique for each device
 currently connected to the system.

 This can be used to distinguish multiple controllers; a gamepad that is disconnected
 and reconnected will retain the same index.

Value
-----

A `number`.

Examples
--------


```js
window.addEventListener("gamepadconnected", () => {
  const gp = navigator.getGamepads()[0];
  gamepadInfo.textContent = `Gamepad connected at index ${gp.index}: ${gp.id}.`;
});
```

Specifications
--------------

| Specification |
| --- |
| Gamepad # dom-gamepad-index |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

Using the Gamepad API
Gamepad: hand property
======================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`hand`** read-only property of the `Gamepad` interface returns an enum defining what hand the controller is being held in, or is most likely to be held in.

Value
-----

A `GamepadHand` enum; possible values are:

* `left` — the left hand.
* `right` — the right hand.
* `""` (Empty string) – if the other values are not applicable. E.g., the controller is held in both hands or would be fine in either.
Examples
--------

TBC

Specifications
--------------

| Specification |
| --- |
| Gamepad Extensions # dom-gamepad-hand |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Gamepad API
Gamepad: id property
====================

 The **`Gamepad.id`** property of the `Gamepad`
 interface returns a string containing some information about the controller.

 The exact syntax is not strictly specified, but in Firefox it will contain three pieces
 of information separated by dashes (`-`):

* Two 4-digit hexadecimal strings containing the USB vendor and product id of the
 controller
* The name of the controller as provided by the driver.

For example, a PS2 controller returned **810-3-USB Gamepad**.

 This information is intended to allow you to find a mapping for the controls on the
 device as well as display useful feedback to the user.

Value
-----

A string primitive.

Examples
--------


```js
window.addEventListener("gamepadconnected", () => {
  const gp = navigator.getGamepads()[0];
  gamepadInfo.textContent = `Gamepad connected at index ${gp.index}: ${gp.id}.`;
});
```

Specifications
--------------

| Specification |
| --- |
| Gamepad # dom-gamepad-id |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

Using the Gamepad API
Gamepad: displayId property
===========================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The **`displayId`** read-only property of the `Gamepad` interface *returns the `VRDisplay.displayId` of the associated `VRDisplay` — the `VRDisplay` that the gamepad is controlling the displayed scene of.*

A Gamepad is considered to be associated with a `VRDisplay` if it reports a pose that is in the same space as the display's pose, see `VRDisplay.getPose()`.

**Note:** This property was part of the old WebVR API. It has been superseded by the WebXR Gamepads Module.

There is no direct replacement for this property. The `Gamepad` object associated with an `XRInputSource` can be obtained using the `XRInputSource.gamepad` property.

Value
-----

A number representing the associated `VRDisplay.displayId`. If the number is 0, then the gamepad is not associated with a VR display.

Examples
--------


```js
window.addEventListener("gamepadconnected", (e) => {
  if (!e.gamepad.displayId) {
    console.log("Gamepad connected");
  } else {
    console.log(
      `Gamepad connected, associated with VR display ${e.gamepad.displayId}`,
    );
  }
});
```

Specifications
--------------

This property was part of the old WebVR API that has been superseded by the WebXR Gamepads Module. It is no longer on track to becoming a standard.

Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers [1].

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebVR API
Gamepad: axes property
======================

 The **`Gamepad.axes`** property of the `Gamepad`
 interface returns an array representing the controls with axes present on the device
 (e.g. analog thumb sticks).

 Each entry in the array is a floating point value in the range -1.0 – 1.0, representing
 the axis position from the lowest value (-1.0) to the highest value (1.0).

Value
-----

An array of numbers.

Examples
--------


```js
function gameLoop() {
  const [gp] = navigator.getGamepads();

  let a = 0;
  let b = 0;
  if (gp.axes[0] !== 0) {
    b -= gp.axes[0];
  } else if (gp.axes[1] !== 0) {
    a += gp.axes[1];
  } else if (gp.axes[2] !== 0) {
    b += gp.axes[2];
  } else if (gp.axes[3] !== 0) {
    a -= gp.axes[3];
  }

  ball.style.left = `${a \* 2}px`;
  ball.style.top = `${b \* 2}px`;

  const start = requestAnimationFrame(gameLoop);
}
```

Specifications
--------------

| Specification |
| --- |
| Gamepad # dom-gamepad-axes |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

Using the Gamepad API
Gamepad: vibrationActuator property
===================================

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The **`vibrationActuator`** read-only property of the `Gamepad` interface returns a `GamepadHapticActuator` object, which represents haptic feedback hardware available on the controller.

Value
-----

A `GamepadHapticActuator` object.

Examples
--------


```js
const gamepad = navigator.getGamepads()[0];

gamepad.vibrationActuator.playEffect("dual-rumble", {
  startDelay: 0,
  duration: 200,
  weakMagnitude: 1.0,
  strongMagnitude: 1.0,
});
```

Specifications
--------------

#### No specification found

No specification data found for `api.Gamepad.vibrationActuator`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Gamepad API
Gamepad: mapping property
=========================

 The **`Gamepad.mapping`** property of the
 `Gamepad` interface returns a string indicating whether the browser has
 remapped the controls on the device to a known layout.

The currently supported known layouts are:

* "standard" for the standard gamepad.
* "xr-standard for the standard XR gamepad. See also `XRInputSource.gamepad`.
Examples
--------


```js
let gp = navigator.getGamepads()[0];
console.log(gp.mapping);
```

Specifications
--------------

| Specification |
| --- |
| Gamepad # dom-gamepad-mapping |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

Using the Gamepad API
Gamepad: timestamp property
===========================

 The **`Gamepad.timestamp`** property of the
 `Gamepad` interface returns a `DOMHighResTimeStamp`
 representing the last time the data for this gamepad was updated.

 The idea behind this is to allow developers to determine if the `axes` and
 `button` data have been updated from the hardware. The value must be
 relative to the `navigationStart` attribute of the
 `PerformanceTiming` interface. Values are monotonically
 increasing, meaning that they can be compared to determine the ordering of updates, as
 newer values will always be greater than or equal to older values.

**Note:** This property is not currently supported anywhere.

Value
-----

A `DOMHighResTimeStamp` object.

Examples
--------


```js
const gp = navigator.getGamepads()[0];
console.log(gp.timestamp);
```

Specifications
--------------

| Specification |
| --- |
| Gamepad # dom-gamepad-timestamp |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

Using the Gamepad API
Gamepad: connected property
===========================

 The **`Gamepad.connected`** property of the
 `Gamepad` interface returns a boolean indicating whether the gamepad is
 still connected to the system.

 If the gamepad is connected, the value is `true`; if not, it is
 `false`.

Value
-----

A boolean.

Examples
--------


```js
const gp = navigator.getGamepads()[0];
console.log(gp.connected);
```

Specifications
--------------

| Specification |
| --- |
| Gamepad # dom-gamepad-connected |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

Using the Gamepad API