Skip to content
Related Articles

Related Articles

HTML | DOM Input Date stepUp() Method

View Discussion
Improve Article
Save Article
Like Article
  • Difficulty Level : Basic
  • Last Updated : 17 Jan, 2022

The Input Date stepUp() method in HTML DOM is used to increment the value of date field by a specified number. The Input Date stepUp() method can only be used on the days and not on months and years.


inputdateObject.stepUp( number )

Parameters: This method accepts single parameter number which is used to specify the amount of days the date field should increase. when we exclude number from inputdateObject.stepUp(number) and leave it as inputdateObject.stepUp() then by default number of days incremented by 1.

Below program illustrates the Input Date stepUp method in HTML DOM:

Example: This example use Input Date stepUp() method to increment the value of date field by 2 days.

<!DOCTYPE html>
        Input Date stepUp Property
<body style="text-align:center;">
    <h1 style="color:green;">
    <h2 style="text-align:center;">
        Input Date stepUp Property
    <input type="date" id="Test_Date">
        To increase the step, double click
        the "Increase Step" button.
    <button ondblclick="My_Date()">
        Increase Step
    <!-- Script to use Input Date stepUp() Method -->
        function My_Date() {

Before clicking on the button:

After clicking on the button:

Supported Browsers

  • Apple Safari
  • Internet Explorer 12.0
  • Firefox 17.0
  • Google Chrome
  • Opera

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!