<!DOCTYPE html>
<html>
<body>

Month and year: <input type="month" id="myMonth">

<p>Click the button to set a month and year for the month field.</p>

<button onclick="myFunction()">Try it</button>

<p><strong>Note:</strong> input elements with type="month" are not supported in Internet Explorer or Firefox.</p>

<p id="demo"></p>

<script>
function myFunction() {
    document.getElementById("myMonth").value = "2014-02";
}
</script>

</body>
</html>