JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" class="num" maxlength="2"/>

JavaScript

$(".num").keypress(function(e){
    var val = this.value;
    var value =  val + String.fromCharCode('36');
    (val.length == '2') ? $(this).val(value+'/') : '';
});