recursal/MDN huggingface dataset:
HTMLLabelElement: form property
===============================

 The read-only **`HTMLLabelElement.form`** property returns an
 `HTMLFormElement` object which represents the form of which the label's
 associated control is a part, or null if there is either no associated control, or if
 that control isn't in a form.

This property is just a shortcut for `HTMLLabelElement.control.form`.

Value
-----

 An `HTMLFormElement` which represents the form with which the label's
 `control` is associated. If
 `control` is `null` (meaning the
 label isn't associated with a control), or if the control isn't part of a form, this
 property returns `null`.

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

| Specification |
| --- |
| HTML Standard # dom-label-form-dev |

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

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

See also
--------

* `HTMLLabelElement`
* `HTMLElement`
* `<label>`
* HTML forms guide
HTMLLabelElement: htmlFor property
==================================

 The **`HTMLLabelElement.htmlFor`** property reflects the value
 of the `for` content property. That means that this
 script-accessible property is used to set and read the value of the content property
 `for`, which is the ID of the label's associated control element.

Value
-----

 A string which contains the ID string of the element which is
 associated with the control.


**Note:** If this property has a value, the `HTMLLabelElement.control` property
 must refer to the same control.


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

| Specification |
| --- |
| HTML Standard # dom-label-htmlfor |

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

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

See also
--------

* `HTMLLabelElement`
* `HTMLLabelElement.control`
* `HTMLElement`
* `<label>`
* HTML forms guide
HTMLLabelElement: control property
==================================

 The read-only **`HTMLLabelElement.control`** property returns a
 reference to the control (in the form of an object of type `HTMLElement` or
 one of its derivatives) with which the `<label>` element is associated,
 or `null` if the label isn't associated with a control.

Value
-----

 An `HTMLElement` derived object representing the control with which the
 `<label>` is associated, or `null` if the label stands alone.


**Note:** If this property has a value and `HTMLLabelElement.htmlFor` has a value,
 the `HTMLLabelElement.htmlFor` property must refer to the same control.


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

| Specification |
| --- |
| HTML Standard # dom-label-control-dev |

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

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

See also
--------

* `HTMLLabelElement`
* `HTMLElement`
* `<label>`
* HTML forms guide
RTCRtpSender: dtmf property
===========================

 The read-only **`dtmf`** property on the
 **`RTCRtpSender`** interface returns a
 `RTCDTMFSender` object which can be used to send DTMF tones
 over the `RTCPeerConnection`. See Using DTMF for details on how to
 make use of the returned `RTCDTMFSender` object.

Value
-----

 An `RTCDTMFSender` which can be used to send DTMF over the RTP session, or
 `null` if the track being carried by the RTP session or the
 `RTCPeerConnection` as a whole doesn't support DTMF.


**Note:** Only audio tracks can support DTMF, and typically only one audio track per
 `RTCPeerConnection` will have an associated `RTCDTMFSender`

Example
-------

tbd

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

| Specification |
| --- |
| WebRTC: Real-Time Communication in Browsers # dom-rtcrtpsender-dtmf |

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

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

See also
--------

* WebRTC API
* Using DTMF with WebRTC
* `RTCPeerConnection`
* `RTCDTMFSender`
* `RTCRtpSender`
RTCRtpSender: track property
============================

 The **`track`** read-only property of
 the `RTCRtpSender` interface returns the `MediaStreamTrack`
 which is being handled by the `RTCRtpSender`.

Value
-----

 A `MediaStreamTrack` object representing the media associated with the
 `RTCRtpSender`. If no track is associated with the sender, this value is
 `null`, in which case the sender transmits nothing.

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

| Specification |
| --- |
| WebRTC: Real-Time Communication in Browsers # dom-rtcrtpsender-track |

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

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

 The **`transform`** property of the `RTCRtpSender` object is used to insert a transform stream (`TransformStream`) running in a worker thread into the sender pipeline.
 This allows stream transforms to be applied to encoded video and audio frames after they are output by a codec, and before they are sent.

 The transform that is to be added is defined using an `RTCRtpScriptTransform` and its associated `Worker`.
 If the transform is set synchronously immediately after creating the `RTCRtpSender` it will receive the first full frame generated by the sender's encoder.

### Value

A `RTCRtpScriptTransform`, or `null` if the sender has no associated transform stream.

Example
-------

 This example shows how you might stream video from a user's webcam over WebRTC, adding a WebRTC encoded transform to modify the outgoing streams.
 Note that this is part of a larger example in the guide topic Using WebRTC Encoded Transforms.

 The code assumes that there is an `RTCPeerConnection` called `peerConnection` that is already connected to a remote peer.
 It first gets a `MediaStreamTrack`, using `getUserMedia()` to get a video `MediaStream` from a media device, and then the `MediaStream.getTracks()` method to get the first `MediaStreamTrack` in the stream.

 The track is added to the peer connection using `addTrack()`.
 This returns a new `RTCRtpSender` that will be used to send it.


```js
const mediaStream = await navigator.mediaDevices.getUserMedia({ video: true });
const [track] = mediaStream.getTracks();
const videoSender = peerConnection.addTrack(track, mediaStream);
```


 The code above sets up the connection and starts sending the track.
 To add a transform stream into the pipeline we need to construct an `RTCRtpScriptTransform` and assign it to the sender's `transform` property.
 As the transform is constructed immediately after creation of the `RTCRtpSender`, it will receive the first frame generated by the sender's encoder, before it is sent.


```js
const worker = new Worker("worker.js");
videoSender.transform = new RTCRtpScriptTransform(worker, {
  name: "senderTransform",
});
```


 Note that you can add the transform at any time.
 However by adding it immediately after calling `addTrack()` the transform will get the first encoded frame that is sent.

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

| Specification |
| --- |
| WebRTC Encoded Transform # dom-rtcrtpsender-transform |

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

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

See also
--------

* Using WebRTC Encoded Transforms
* `RTCRtpReceiver.transform`
RTCRtpSender: setStreams() method
=================================

The `RTCRtpSender` method **`setStreams()`** associates the sender's `track` with the specified `MediaStream` objects.

Syntax
------


```js
setStreams()
setStreams(mediaStream1)
setStreams(mediaStream1, mediaStream2)
setStreams(mediaStream1, mediaStream2, /\* …, \*/ mediaStreamN)
```

### Parameters

`mediaStreamN` Optional

 An arbitrary number of `MediaStream` objects specified as arguments, that identify the streams to which the `RTCRtpSender`'s `track` belongs.
 If this parameter isn't specified, no new streams will be associated with the track.


### Return value

None (`undefined`).

### Exceptions

`InvalidStateError` `DOMException`

Thrown if the sender's connection is closed.

Description
-----------

`setStreams()` is purely additive. It doesn't remove the track from any streams; it adds it to new ones.
 If you specify streams to which the track already belongs, that stream is unaffected.

Once the track has been added to all of the streams, renegotiation of the connection will be triggered by the `negotiationneeded` event being dispatched to the `RTCPeerConnection` to which the sender belongs.

Examples
--------

This example adds all of an `RTCPeerConnection`'s tracks to the specified stream.


```js
function addTracksToStream(stream) {
  let senders = pc.getSenders();

  senders.forEach((sender) => {
    if (sender.track && sender.transport.state === connected) {
      sender.setStreams(stream);
    }
  });
}
```


 After calling the `RTCPeerConnection` method `getSenders()` to get the list of the connection's senders, the `addTracksToStream()` function iterates over the list.
 For each sender, if the sender's track is non-null and its transport's state is `connected`, we call `setStreams()` to add the track to the `stream` specified.

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

| Specification |
| --- |
| WebRTC: Real-Time Communication in Browsers # dom-rtcrtpsender-setstreams |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
RTCRtpSender: getStats() method
===============================

The `RTCRtpSender` method **`getStats()`** asynchronously requests an `RTCStatsReport` object which provides statistics about outgoing traffic on the `RTCPeerConnection` which owns the sender, returning a `Promise` which is fulfilled when the results are available.

Syntax
------


```js
getStats()
```

### Parameters

None.

### Return value

 A JavaScript `Promise` which is fulfilled once the statistics are available.
 The promise's fulfillment handler receives as a parameter a `RTCStatsReport` object containing the collected statistics.

The returned `RTCStatsReport` accumulates the statistics for all of the streams being sent using the `RTCRtpSender`, as well as the statistics for any dependencies those streams have.

These might include, for example, statistics with types: `outbound-rtp`, `candidate-pair`, `local-candidate`, `remote-candidate`.

Examples
--------

This simple example obtains the statistics for an `RTCRtpSender` and updates an element's `innerText` to display the current round trip time for requests on the sender.


```js
sender.getStats().then((stats) => {
  document.getElementById("currentRTT").innerText = stats.roundTripTime;
});
```

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

| Specification |
| --- |
| WebRTC: Real-Time Communication in Browsers # widl-RTCRtpSender-getStats-Promise-RTCStatsReport |

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

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

See also
--------

* WebRTC API
* `RTCStatsReport`
* `RTCRtpReceiver.getStats()`
* `RTCPeerConnection.getStats()`
RTCRtpSender: transport property
================================

 The read-only **`transport`** property of an
 `RTCRtpSender` object provides the `RTCDtlsTransport` object
 used to interact with the underlying transport over which the sender is exchanging
 Real-time Transport Control Protocol (RTCP) packets.

 This transport is responsible for receiving the data for the media on the sender's
 `track`.

Value
-----

 An `RTCDtlsTransport` object representing the underlying transport being
 used by the sender to exchange packets with the remote peer, or `null` if the
 sender isn't yet connected to a transport.

Description
-----------

 When the `RTCRtpSender` is first created, the value of
 `transport` is `null`. This is replaced with an
 `RTCDtlsTransport` once the sender's transport has been established.

 Note that when bundling is in effect—that is, when the `RTCPeerConnection`
 was created with a configuration object whose `bundlePolicy` is `max-compat`
 or `max-bundle`—multiple senders may be sharing the same transport; in this
 case, all of them are using the same connection to transmit and/or receive
 RTP and RTCP packets.

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

| Specification |
| --- |
| WebRTC: Real-Time Communication in Browsers # dom-rtcrtpsender-transport |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
FileSystemDirectoryHandle: keys() method
========================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`keys()`** method of the
 `FileSystemDirectoryHandle` interface returns a new asynchronous iterator
 for the iteration of the key of the entries within the `FileSystemDirectoryHandle`
 on which this method is called.

Syntax
------


```js
FileSystemDirectoryHandle.keys()
```

### Parameters

None.

### Return value

A new asynchronous iterator containing the keys of each entry within the `FileSystemDirectoryHandle`.

### Exceptions

`NotAllowedError` `DOMException`

Thrown if the `PermissionStatus.state` for the handle is not `'granted'` in `read` mode.

`NotFoundError` `DOMException`

Thrown if the current entry is not found.

Examples
--------

Use the `for await...of` loop can simplify the iteration process.


```js
const dirHandle = await window.showDirectoryPicker();

for await (const key of dirHandle.keys()) {
  console.log(key);
}
```

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

| Specification |
| --- |
| File System Standard # api-filesystemdirectoryhandle-asynciterable |

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

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

See also
--------

* File System API
* The File System Access API: simplifying access to local files
FileSystemDirectoryHandle: getFileHandle() method
=================================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`getFileHandle()`** method of the
 `FileSystemDirectoryHandle` interface returns a
 `FileSystemFileHandle` for a file with the specified name, within the
 directory the method is called.

Syntax
------


```js
getFileHandle(name)
getFileHandle(name, options)
```

### Parameters

`name`

 A string representing the `FileSystemHandle.name` of
 the file you wish to retrieve.


`options` Optional

An object with the following properties:

`create` Optional

 A `Boolean`. Default `false`. When
 set to `true` if the file is not found, one with the specified name
 will be created and returned.



### Return value

A `Promise` which resolves with a `FileSystemFileHandle`.

### Exceptions

`NotAllowedError` `DOMException`

Thrown if the `PermissionStatus.state` for the handle is not `'granted'` in `readwrite` mode if the `create` option is set to `true` or in `read` mode if the `create` option is set to `false`.

`TypeError`

 Thrown if the name specified is not a valid string or contains characters that would
 interfere with the native file system.


`TypeMismatchError` `DOMException`

Thrown if the named entry is a directory and not a file.

`NotFoundError` `DOMException`

 Thrown if the current entry is not found or if the file doesn't exist and the `create` option is set to
 `false`.


Examples
--------

 The following example returns a file handle with the specified name, if the file does
 not exist it is created.


```js
const fileName = "fileToGetName";

// assuming we have a directory handle: 'currentDirHandle'
const fileHandle = currentDirHandle.getFileHandle(fileName, { create: true });
```

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

| Specification |
| --- |
| File System Standard # api-filesystemdirectoryhandle-getfilehandle |

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

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

See also
--------

* File System API
* The File System Access API: simplifying access to local files
FileSystemDirectoryHandle: getDirectoryHandle() method
======================================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`getDirectoryHandle()`** method of the
 `FileSystemDirectoryHandle` interface returns a
 `FileSystemDirectoryHandle` for a subdirectory with the specified name
 within the directory handle on which the method is called.

Syntax
------


```js
getDirectoryHandle(name)
getDirectoryHandle(name, options)
```

### Parameters

`name`

 A string representing the `FileSystemHandle.name` of
 the subdirectory you wish to retrieve.


`options` Optional

 An optional object containing options for the retrieved subdirectory. Options are as
 follows:


`create` Optional

 A boolean value, which defaults to `false`. When
 set to `true` if the directory is not found, one with the specified
 name will be created and returned.



### Return value

A `Promise` which resolves with a `FileSystemDirectoryHandle`.

### Exceptions

`NotAllowedError` `DOMException`

Thrown if the `PermissionStatus.state` for the handle is not `'granted'` in `readwrite` mode if the `create` option is set to `true` or in `read` mode if the `create` option is set to `false`.

`TypeError`

 Thrown if the name specified is not a valid string or contains characters that would
 interfere with the native file system.


`TypeMismatchError` `DOMException`

Thrown if the returned entry is a file and not a directory.

`NotFoundError` `DOMException`

 Thrown if the current entry is not found or if the target directory doesn't exist and the `create` option is set to
 `false`.


Examples
--------

 The following example returns a directory handle with the specified name, if the
 directory does not exist it is created.


```js
const dirName = "directoryToGetName";

// assuming we have a directory handle: 'currentDirHandle'
const subDir = currentDirHandle.getDirectoryHandle(dirName, { create: true });
```

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

| Specification |
| --- |
| File System Standard # api-filesystemdirectoryhandle-getdirectoryhandle |

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

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

See also
--------

* File System API
* The File System Access API: simplifying access to local files
FileSystemDirectoryHandle: entries() method
===========================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`entries()`** method of the
 `FileSystemDirectoryHandle` interface returns a new asynchronous iterator
 for the iteration of the key-value pairs of the entries within the `FileSystemDirectoryHandle`
 on which this method is called. The key-value pairs are
 in the form of an array like `[key, value]`.

Syntax
------


```js
entries()
```

### Parameters

None.

### Return value

A new asynchronous iterator containing the key-value pairs of each entry within the `FileSystemDirectoryHandle`.

### Exceptions

`NotAllowedError` `DOMException`

Thrown if the `PermissionStatus.state` for the handle is not `'granted'` in `read` mode.

`NotFoundError` `DOMException`

Thrown if the current entry is not found.

Examples
--------

Use the `for await...of` loop can simplify the iteration process.


```js
const dirHandle = await window.showDirectoryPicker();

for await (const [key, value] of dirHandle.entries()) {
  console.log({ key, value });
}
```

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

| Specification |
| --- |
| File System Standard # api-filesystemdirectoryhandle-asynciterable |

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

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

See also
--------

* File System API
* The File System Access API: simplifying access to local files
FileSystemDirectoryHandle: resolve() method
===========================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`resolve()`** method of the
 `FileSystemDirectoryHandle` interface returns an `Array` of
 directory names from the parent handle to the specified child entry, with the name of
 the child entry as the last array item.

Syntax
------


```js
resolve(possibleDescendant)
```

### Parameters

`possibleDescendant`

The `FileSystemHandle` from which to return the relative path.

### Return value

 A `Promise` which resolves with an `Array` of
 strings, or `null` if `possibleDescendant` is not a descendant of this `FileSystemDirectoryHandle`.

### Exceptions

No exceptions are thrown.

Examples
--------

 The following asynchronous function uses `resolve()` to find the path to a
 chosen file, relative to a specified directory handle.


```js
async function returnPathDirectories(directoryHandle) {
  // Get a file handle by showing a file picker:
  const [handle] = await self.showOpenFilePicker();
  if (!handle) {
    // User cancelled, or otherwise failed to open a file.
    return;
  }

  // Check if handle exists inside our directory handle
  const relativePaths = await directoryHandle.resolve(handle);

  if (relativePaths === null) {
    // Not inside directory handle
  } else {
    // relativePath is an array of names, giving the relative path
    for (const name of relativePaths) {
      // log each entry
      console.log(name);
    }
  }
}
```

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

| Specification |
| --- |
| File System Standard # api-filesystemdirectoryhandle-resolve |

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

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

See also
--------

* File System API
* The File System Access API: simplifying access to local files
FileSystemDirectoryHandle: removeEntry() method
===============================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`removeEntry()`** method of the
 `FileSystemDirectoryHandle` interface attempts to remove an entry if the
 directory handle contains a file or directory called the name specified.

Syntax
------


```js
removeEntry(name)
removeEntry(name, options)
```

### Parameters

`name`

 A string representing the `FileSystemHandle.name` of
 the entry you wish to remove.


`options` Optional

An optional object containing options, which are as follows:

`recursive` Optional

A boolean value, which defaults to `false`. When set to `true` entries will be removed recursively.


### Return value

A `Promise` which resolves with `undefined`.

### Exceptions

`TypeError`

Thrown if the name is not a valid string or contains characters not allowed on the file system.

`NotAllowedError` `DOMException`

Thrown if the `PermissionStatus.state` for the handle is not `'granted'` in `readwrite` mode.

`InvalidModificationError` `DOMException`

Thrown if `recursive` is set to false and the entry to be removed has children.

`NotFoundError` `DOMException`

Thrown if the current entry is not found or if the entry of the specific name is not found or matched.

Examples
--------

The following example removes an entry within the directory handle.


```js
const entryName = "entryToRemove";

// assuming we have a directory handle: 'currentDirHandle'
currentDirHandle.removeEntry(entryName).then(() => {
  // code to run if removing was successful
});
```

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

| Specification |
| --- |
| File System Standard # api-filesystemdirectoryhandle-removeentry |

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

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

See also
--------

* File System API
* The File System Access API: simplifying access to local files