HTMLOutputElement: htmlFor-Eigenschaft
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2018.
Die htmlFor
-Eigenschaft der HTMLOutputElement
-Schnittstelle ist ein String, der eine durch Leerzeichen getrennte Liste von id
s anderer Elemente enthält. Sie gibt an, dass diese Elemente Eingabewerte zur Berechnung beigetragen haben (oder diese auf andere Weise beeinflusst haben). Sie spiegelt das for
-Attribut des <output>
-Elements wider.
Wert
Ein String.
Beispiele
js
const outputElem = document.getElementById("result");
for (const id of outputElem.htmlFor.split(" ")) {
const elem = document.getElementById(id);
elem.style.outline = "2px solid red";
}
Spezifikationen
Specification |
---|
HTML # dom-output-htmlfor |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
htmlFor |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.