HTMLButtonElement: commandForElement-Eigenschaft
Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.
Die commandForElement
-Eigenschaft der HTMLButtonElement
-Schnittstelle ruft das Element ab und setzt es, das über einen Button gesteuert wird.
Es ist das JavaScript-Äquivalent des commandfor
-HTML-Attributs.
Wert
Ein Verweis auf ein vorhandenes Element
, das der Button steuert.
Beispiele
js
const popover = document.getElementById("mypopover");
const toggleBtn = document.getElementById("toggleBtn");
toggleBtn.commandForElement = popover;
Spezifikationen
Specification |
---|
HTML # dom-button-commandforelement |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
commandForElement |
Legend
Tip: you can click/tap on a cell for more information.
- No support
- No support
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.
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.