Javascript examples for DOM HTML Element:Input Week
The step property sets or gets the step attribute of a week field, which identifies the legal week intervals to choose from when the user opens the calendar in a week field.
For example, if step = "2", you can only select every second week in the calendar.
Set the step property with the following Values
Value | Description |
---|---|
number | Sets the legal week intervals. Default is 1 week. |
Examples:
A Number, representing the legal week intervals
The following code shows how to change the legal week intervals:
<!DOCTYPE html> <html> <body> <input type="week" id="myWeek" value="2018-W15"> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w w w. j a v a2s . c o m*/ document.getElementById("myWeek").stepUp(); } </script> </body> </html>