W3cubDocs

/Web APIs

HTMLFormElement: rel property

Baseline 2023
Newly available

Since ⁨March 2023⁩, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The rel property of the HTMLFormElement interface reflects the rel attribute. It is a string containing what kinds of links the HTML <form> element creates, as a space-separated list of enumerated values.

To retrieve the value as an array of tokens, use HTMLFormElement.relList.

Value

A string.

Examples

const form = document.querySelector("form");
console.log(form.rel);

form.rel = "noopener noreferrer";

Specifications

Specification
HTML>
# dom-form-rel>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
rel 108 108 111 94 15.4 108 111 73 15.4 21.0 108 15.4

See also

© 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/rel