Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> Enter a date between 1980-01-01 and 2000-01-01: <input type="date" id="myDate" name="bday" min="1980-01-01" max="2000-01-01"> <p>Click the button to display the value of the max attribute of the date field.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { let x = document.getElementById("myDate").max; document.getElementById("demo").innerHTML = x; } </script> </body> </html>