Javascript examples for DOM HTML Element:Input Date
The step property sets or gets the step attribute of a date field, which control the day intervals to choose from.
Set the step property with the following Values
Value | Description |
---|---|
number | Sets the legal day intervals. Default is 1 day. |
Examples:
A Number, representing the legal day intervals
The following code shows how to change the legal day intervals:
<!DOCTYPE html> <html> <body> Date: <input type="date" id="myDate" value="2018-05-05"> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from ww w. j a v a2 s. c o m*/ document.getElementById("myDate").stepUp(); } </script> </body> </html>