HTMLFormElement: relList property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2023.
The relList
read-only property of the HTMLFormElement
interface reflects the rel
attribute. It is a live DOMTokenList
containing the set of link types indicating the relationship between the resource represented by the <form>
element and the current document.
The property itself is read-only, meaning you can not reassign the property with another DOMTokenList
, but the content of the returned list can be changed.
To retrieve a string containing the values as space-separated tokens, use HTMLFormElement.rel
. The rel
property can also be used to set the rel
attribute value.
Value
A live DOMTokenList
of strings.
Examples
const form = document.querySelector("form"); form.relList.forEach((relEntry) => { console.log(relEntry); });
Specifications
Specification |
---|
HTML> # dom-form-rellist> |
Browser compatibility
Loading…