Edit in JSFiddle

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

              
var input = document.getElementById('mmjj');

input.oninput = function(){
  if (this.value.length<3) return;
  this.value = this.value.replace('/','');
  this.value = this.value.substring(0, 2) + '/' + this.value.substring(2);
};