Javascript examples for DOM HTML Element:Input Week
The max property sets or gets the max attribute of a week field, which sets the maximum week and year for a week field.
Set the max property with the following Values
Value | Description |
---|---|
YYYY-WWW | Sets the maximum week and year allowed. |
Example: 2018-W15
A String, representing the maximum week and year allowed
The following code shows how to get the maximum week and year allowed for a week field:
<!DOCTYPE html> <html> <body> Week and Year:/*from w w w .j ava 2 s . co m*/ <input type="week" id="myWeek" min="2018-W12" max="2018-W19"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myWeek").max; document.getElementById("demo").innerHTML = v; } </script> </body> </html>