Javascript examples for DOM HTML Element:Input Month
The step property sets or gets the step attribute of a month field, which controls the legal month intervals to choose from when the user opens the calendar in the month field.
Set the step property with the following Values
Value | Description |
---|---|
number | Sets the legal month intervals. Default is 1 month. |
Examples:
A Number, representing the legal month intervals
The following code shows how to change the legal month intervals:
<!DOCTYPE html> <html> <body> Month and year: <input type="month" id="myMonth" value="1997-11"> <button onclick="myFunction()">Test</button> <script> function myFunction() {//from w w w. j ava2 s .c om document.getElementById("myMonth").stepUp(); } </script> </body> </html>