JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" name="phone">
<button disabled>pew</button>
JavaScript
const checkLength = function(evt) {
if (phoneField.value.length > 5) {
button.removeAttribute('disabled')
}
}
const phoneField = document.querySelector('input[name="phone"]')
const button = document.querySelector('button')
phoneField.addEventListener('keyup', checkLength)