Disable and enable a month field:
<!DOCTYPE html> <html> <body> <input type="month" id="myMonth"><br><br> <button onclick="disableBtn()">Disable Month Field</button> <button onclick="enableBtn()">enable Month Field</button> <script> function disableBtn() {/* w ww .j a va 2 s . co m*/ document.getElementById("myMonth").disabled = true; } function enableBtn() { document.getElementById("myMonth").disabled = false; } </script> </body> </html>