hi
I want to display remaining Characters in a label, which the client types in textbox
I want this to display how many characters are left after each character when users type into textbox
can you help me?
best regards
neda
Hi nedash,
Refer the below code.
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> $(function () { $('[id*=txtCount]').on("keyup", function () { $('[id*=lblCount]').html($(this).val().length); }); }); </script> </head> <body> <form id="form1" runat="server"> <div> <input type="text" name="txtCount" id="txtCount" /> <br /> <span>No of Character : </span><span id="lblCount"></span> </div> </form> </body> </html>
Demo
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.