
- 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 stepUp() Method
The HTML DOM Input Date stepUp() method defines the amount of days the date field should increase.
Syntax
Following is the syntax −
Calling stepUp method with a number, which by default is equal to 1
inputDateObject.stepUp(number)
Example
Let us see an example of Input Date stepUp method −
<!DOCTYPE html> <html> <head> <title>Input Date stepUp()</title> </head> <body> <form> <div> Calendar: <input type="date" id="dateSelect" value="2019-06-06"> </div> </form> <button onclick="changeStep(2)">Increase by 2</button> <button onclick="changeStep(3)">Increase by 3</button> <div id="divDisplay"></div> <script> var divDisplay = document.getElementById("divDisplay"); var inputDate = document.getElementById("dateSelect"); function changeStep(num){ if(num===2) inputDate.stepUp(2); else inputDate.stepUp(3); divDisplay.textContent = 'Current date increased by: '+num; } </script> </body> </html>
Output
This will produce the following output −
Clicking ‘Increase by 2’ button −
Clicking ‘Increase by 3’ button −
- Related Articles
- HTML DOM Input Week stepUp( ) Method
- HTML DOM Input Range stepUp() method
- HTML DOM Input Month stepUp() Method
- HTML DOM Input Number stepUp() Method
- HTML DOM Input DatetimeLocal stepUp( ) Method
- HTML DOM Input Time stepUp( ) Method
- HTML DOM Input Date stepDown() Method
- HTML DOM Input Date Object
- 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 max Property
- HTML DOM Input Date min Property
- HTML DOM Input Date readOnly Property

Advertisements