Javascript examples for DOM HTML Element:Input Week
The min property sets or gets the min attribute of a week field, which sets the minimum week and year for a week field.
Set the min property with the following Values
Value | Description |
---|---|
YYYY-WWW | Sets the minimum week and year allowed. |
Example: 2018-W15
A String, representing the minimum week and year allowed
The following code shows how to get the minimum week and year allowed for a week field:
<!DOCTYPE html> <html> <body> Week and Year:/*w w w. j a va 2 s .c o 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").min; document.getElementById("demo").innerHTML = x; } </script> </body> </html>