JSFiddle - React, Tailwind, and code Playground

HTML

<input type='text' id='inp' maxlength='5'/>

JavaScript

$('#inp').live('keyup',function(){
    alert($(this).val().length)
})