HTMLInputElement: defaultChecked-Eigenschaft
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Die defaultChecked
-Eigenschaft der HTMLInputElement
-Schnittstelle gibt den standardmäßigen Aktivierungszustand des Elements an. Diese Eigenschaft spiegelt das checked
-Attribut des <input>
-Elements wider.
Das boolesche checked
-Attribut ist für die Eingabetypen radio
(<input type="radio">
) und checkbox
(<input type="checkbox">
) gültig. Das Vorhandensein des Attributs setzt die defaultChecked
-Eigenschaft auf true
.
Wert
Ein boolescher Wert.
Beispiele
const inputElement = document.getElementById("contactMail");
console.log(inputElement.defaultChecked);
Spezifikationen
Specification |
---|
HTML # dom-input-defaultchecked |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
defaultChecked |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support