If you want to flip your own
HTML
<div> Type text here: <input type="text" id="txt" /> </div> <div id="warning" style="color: red; display: none"> Sorry, too much text. </div> <br> <input type="text" id="counter" disabled="disabled" value="0"/>
Script
$("#txt").keyup(function () { var i = $("#txt").val().length; $("#counter").val(i); if (i > 10) { $("#warning").show() } else { $("#warning").hide() } });
Jsfiddle here
source share