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> Month and year: <input type="month" id="myMonth" value="1997-11"> <p>Click the button to increment the value of the month field by 1 month (each time you click).</p> <p><strong>Note:</strong> This is the same as clicking the up arrow on the right side of the date field for the "month" section.</p> <button onclick="myFunction()">Try it</button> <p><strong>Note:</strong> The stepUp() method is not supported by Firefox.</p> <script> function myFunction() { document.getElementById("myMonth").stepUp(); } </script> </body> </html>