JSFiddle - React, Tailwind, and code Playground

HTML

<input class="cpfcnpj" type="text" />
<button id="botao">Calcular</button>
<div id="output"></div>

JavaScript

$( "#botao" ).click(function() {
var tamanho = $('.cpfcnpj').val();
if (tamanho.length <= 11) {
    $('#output').html('Menor que 11.');
}
else if (tamanho.length > 12) {
    $('#output').html('Maior que 12.');
}
});