运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,暗色/亮色
前往 Spaces
<!DOCTYPE html> <html> <body> Month and year: <input type="month" id="myMonth" value="1997-11"> <p>Click the button to decrement 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 down 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 stepDown() method is not supported by Firefox.</p> <script> function myFunction() { document.getElementById("myMonth").stepDown(); } </script> </body> </html>