JSFiddle - React, Tailwind, and code Playground

by eapo

HTML

<input type="range" class="profileInfo" id="About" style="border:solid;" contenteditable="true">OOOOO</div>
                    <div id="counter"></div>

JavaScript

jQuery(document).ready(function($){
    
        const limit = 10;
        rem = limit - $('#About').text().length;
        $("#counter").append("You have <strong>" + rem + "</strong> chars left.");
        $("#About").on('keypress', function(event) {
            var char = $('#About').text().length;
            if(char>limit)
            {
                event.preventDefault();
                //TODO
            }
            rem = limit - char;
            $("#counter").html("You have <strong>" + rem + "</strong> chars left.");

        });

    });