JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cssglobe.com/lab/charcount/charCount.js"></script>
<form id="myForm">
<input class="message-form" type="text" width="10" />
<input class="message-form" type="text" width="10" />
<input class="message-form" type="text" width="10" />
</form>
JavaScript
$("#myForm").on("focusin", '.message-form', function() {
$(this).next("span.counter").remove();
$(this).charCount({
allowed: 140,
warning: 20
});
}); // on