JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="input" />
<span></span>

JavaScript

$(function(){
    $('input[name="input"]').keyup(function(){
        if($(this).val().length > 10){
            $('span').html('You can\'t type more than 10 characters!');
        }else{
            $('span').empty();
        }
    });
});