HTMLInputElement: max 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 max-Eigenschaft der HTMLInputElement-Schnittstelle spiegelt das max Attribut des <input> Elements wider, welches im Allgemeinen den maximal gültigen Wert für eine numerische oder Datum-Zeit-Eingabe definiert. Wenn das Attribut nicht explizit gesetzt ist, ist die max-Eigenschaft ein leerer String.

Wert

Ein String, der den max-Wert des Elements repräsentiert, oder ein leerer String, wenn kein max explizit gesetzt ist.

Beispiel

js
const inputElement = document.querySelector("#time");
console.log(inputElement.max); // the current value of the max attribute
inputElement.max = "18:00:00"; // sets the max value to 6pm

Spezifikationen

Specification
HTML
# dom-input-max

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
max

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch