JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" maxlength="3">
JavaScript
setTimeout(() => {
document.querySelector('input').setAttribute('maxlength', 3);
}, 1000);
<input type="text" maxlength="3">
setTimeout(() => {
document.querySelector('input').setAttribute('maxlength', 3);
}, 1000);