Input Datetime max Attribute
Definition and Usage
max
Attribute sets or returns the value of the max attribute of the date-time field.
HTML max attribute specifies the maximum value (date and time) for the date-time field.
Tip:Use the max attribute and min attribute to create a valid value range.
Tip:To set or return the value of the min attribute, use min attribute。
See also:
HTML Reference Manual:Atribut max <input> HTML
Instance
Example 1
Get the furthest date and time allowed for the date-time field:
var x = document.getElementById("myDatetime").max;
Example 2
Change the furthest date and time:
document.getElementById("myDatetime").max = "2012-01-01T11:57Z";
Syntax
Return max attribute:
datetimeObject.max
Set max attribute:
datetimeObject.max = YYYY-MM-DDThh:mm:ssTZD
Attribute Value
Value | Description |
---|---|
YYYY-MM-DDThh:mm:ssTZD |
The furthest date and/or time allowed for the specified date-time field. Component Description:
|
Technical Details
Return Value: | Nilai string, yang menandai tanggal dan waktu paling jauh yang diijinkan. |
---|
Dukungan Peramban
Angka di tabel menandai versi peramban pertama yang mendukung atribut ini penuh.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Dukungan | 10.0 | Dukungan | Dukungan | Dukungan |
Perhatian:Elemen <input type="datetime"> tidak menampilkan bidang tanggal dan waktu kalender di seluruh peramban utama kecuali Safari.