Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
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.
A live DOMTokenList of strings.
const form = document.querySelector("form");
form.relList.forEach((relEntry) => {
console.log(relEntry);
});
| Specification |
|---|
| HTML> # dom-form-rellist> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
relList |
108 | 108 | 111 | 94 | 15.4 | 108 | 111 | 73 | 15.4 | 21.0 | 108 | 15.4 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/relList