var input = document.getElementById('mmjj');
input.oninput = function() {
var str = document.getElementById('mmjj');
if (str.value.length > 2) {
document.getElementById('mmjj').value = str.value.substring(0, 2) + '/';
}
}
<input type="text" id="mmjj">