How to put counter for char remaining in textbox Html <asp:TextBox runat="server" ID="TxtBody" CssClass="form-control" TextMode="MultiLine" Rows="5" placeholder="Body" MaxLength="159" ></asp:TextBox> <div id="Textremaining"></div> Javascript $(document).ready(function() { var maxChar = 159; $('#Textremaining').html(maxChar + ' remaining'); $('#<%=TxtBody.ClientID%>').keyup(function() { var length = $('#<%=TxtBody.ClientID%>').val().length; var remaining = maxChar - length; $('#Textremaining').html(remaining + ' characters remaining'); }); });
Post all my problems that i face in development time.that help you