Edit in JSFiddle

<input type="text" id="mmjj">

              
var input = document.getElementById('mmjj');
input.oninput = function() {
    if (this.value.length > 2) {
        this.value =  this.value.substring(0, 2) + '/';
    }
}