JSFiddle - React, Tailwind, and code Playground

HTML

<input type="number" max="99" min="9" id="myInput"/>

JavaScript

myInput.oninput = function () {
    if (this.value.length > 2)
        this.value = this.value.slice(0,2); 
}