
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Input Date max Property
The HTML DOM Input Date max property returns/sets max attribute of Input date type.
Syntax
Following is the syntax −
- Returning string value
inputDateObject.max
- Setting max to string value
inputDateObject.max = YYYY-MM-DD
String Values
Here, “YYYY-MM-DD” can be the following −
stringValue | Details |
---|---|
YYYY | It defines year (eg:1998) |
MM | It defines month (eg: 05 for May) |
DD | It defines Day (eg: 24) |
Example
Let us see an example of Input Date max property −
<!DOCTYPE html> <html> <head> <title>Input Date Max</title> </head> <body> <form> Date Select: <input type="date" id="date" name="DateSelect" max="2018-12-31"> </form> <button onclick="getMaxDate()">Change Max Date</button> <div id="divDisplay"></div> <script> var inputDate = document.getElementById("date"); var divDisplay = document.getElementById("divDisplay"); divDisplay.textContent = 'Max of date input: '+inputDate.max; function getMaxDate() { var oldInputDate = inputDate.max; inputDate.max = '2020-12-31'; divDisplay.textContent = 'Max of date input: '+inputDate.max; } </script> </body> </html>
Output
This will produce the following output −
Before clicking ‘Change Max Date’ button −
After clicking ‘Change Max Date’ button −
- Related Articles
- HTML DOM Input Month max Property
- HTML DOM Input Number max Property
- HTML DOM Input Range max property
- HTML DOM Input Datetime max Property
- HTML DOM Input DatetimeLocal max Property
- HTML DOM Input Time max Property
- HTML DOM Input Week max Property
- HTML DOM Input Date autofocus Property
- HTML DOM Input Date disabled Property
- HTML DOM Input Date form Property
- HTML DOM Input Date name Property
- HTML DOM Input Date min Property
- HTML DOM Input Date readOnly Property
- HTML DOM Input Date required Property
- HTML DOM Input Date step Property

Advertisements